function mkVBScript(e) {
  var t = "error";
  function n(e2) {
    return RegExp("^((" + e2.join(")|(") + "))\\b", "i");
  }
  var r = /* @__PURE__ */ RegExp("^[\\+\\-\\*/&\\\\\\^<>=]"), i = /* @__PURE__ */ RegExp("^((<>)|(<=)|(>=))"), a = /* @__PURE__ */ RegExp("^[\\.,]"), o = /* @__PURE__ */ RegExp("^[\\(\\)]"), s = /* @__PURE__ */ RegExp("^[A-Za-z][_A-Za-z0-9]*"), c = [
    "class",
    "sub",
    "select",
    "while",
    "if",
    "function",
    "property",
    "with",
    "for"
  ], l = [
    "else",
    "elseif",
    "case"
  ], u = [
    "next",
    "loop",
    "wend"
  ], d = n([
    "and",
    "or",
    "not",
    "xor",
    "is",
    "mod",
    "eqv",
    "imp"
  ]), f = [
    "dim",
    "redim",
    "then",
    "until",
    "randomize",
    "byval",
    "byref",
    "new",
    "property",
    "exit",
    "in",
    "const",
    "private",
    "public",
    "get",
    "set",
    "let",
    "stop",
    "on error resume next",
    "on error goto 0",
    "option explicit",
    "call",
    "me"
  ], p = [
    "true",
    "false",
    "nothing",
    "empty",
    "null"
  ], m = /* @__PURE__ */ "abs.array.asc.atn.cbool.cbyte.ccur.cdate.cdbl.chr.cint.clng.cos.csng.cstr.date.dateadd.datediff.datepart.dateserial.datevalue.day.escape.eval.execute.exp.filter.formatcurrency.formatdatetime.formatnumber.formatpercent.getlocale.getobject.getref.hex.hour.inputbox.instr.instrrev.int.fix.isarray.isdate.isempty.isnull.isnumeric.isobject.join.lbound.lcase.left.len.loadpicture.log.ltrim.rtrim.trim.maths.mid.minute.month.monthname.msgbox.now.oct.replace.rgb.right.rnd.round.scriptengine.scriptenginebuildversion.scriptenginemajorversion.scriptengineminorversion.second.setlocale.sgn.sin.space.split.sqr.strcomp.string.strreverse.tan.time.timer.timeserial.timevalue.typename.ubound.ucase.unescape.vartype.weekday.weekdayname.year".split("."), h = /* @__PURE__ */ "vbBlack.vbRed.vbGreen.vbYellow.vbBlue.vbMagenta.vbCyan.vbWhite.vbBinaryCompare.vbTextCompare.vbSunday.vbMonday.vbTuesday.vbWednesday.vbThursday.vbFriday.vbSaturday.vbUseSystemDayOfWeek.vbFirstJan1.vbFirstFourDays.vbFirstFullWeek.vbGeneralDate.vbLongDate.vbShortDate.vbLongTime.vbShortTime.vbObjectError.vbOKOnly.vbOKCancel.vbAbortRetryIgnore.vbYesNoCancel.vbYesNo.vbRetryCancel.vbCritical.vbQuestion.vbExclamation.vbInformation.vbDefaultButton1.vbDefaultButton2.vbDefaultButton3.vbDefaultButton4.vbApplicationModal.vbSystemModal.vbOK.vbCancel.vbAbort.vbRetry.vbIgnore.vbYes.vbNo.vbCr.VbCrLf.vbFormFeed.vbLf.vbNewLine.vbNullChar.vbNullString.vbTab.vbVerticalTab.vbUseDefault.vbTrue.vbFalse.vbEmpty.vbNull.vbInteger.vbLong.vbSingle.vbDouble.vbCurrency.vbDate.vbString.vbObject.vbError.vbBoolean.vbVariant.vbDataObject.vbDecimal.vbByte.vbArray".split("."), g = [
    "WScript",
    "err",
    "debug",
    "RegExp"
  ], _ = [
    "description",
    "firstindex",
    "global",
    "helpcontext",
    "helpfile",
    "ignorecase",
    "length",
    "number",
    "pattern",
    "source",
    "value",
    "count"
  ], v = [
    "clear",
    "execute",
    "raise",
    "replace",
    "test",
    "write",
    "writeline",
    "close",
    "open",
    "state",
    "eof",
    "update",
    "addnew",
    "end",
    "createobject",
    "quit"
  ], y = [
    "server",
    "response",
    "request",
    "session",
    "application"
  ], b = [
    "buffer",
    "cachecontrol",
    "charset",
    "contenttype",
    "expires",
    "expiresabsolute",
    "isclientconnected",
    "pics",
    "status",
    "clientcertificate",
    "cookies",
    "form",
    "querystring",
    "servervariables",
    "totalbytes",
    "contents",
    "staticobjects",
    "codepage",
    "lcid",
    "sessionid",
    "timeout",
    "scripttimeout"
  ], x = [
    "addheader",
    "appendtolog",
    "binarywrite",
    "end",
    "flush",
    "redirect",
    "binaryread",
    "remove",
    "removeall",
    "lock",
    "unlock",
    "abandon",
    "getlasterror",
    "htmlencode",
    "mappath",
    "transfer",
    "urlencode"
  ], S = v.concat(_);
  g = g.concat(h), e.isASP && (g = g.concat(y), S = S.concat(x, b));
  var C = n(f), w = n(p), T = n(m), E = n(g), D = n(S), O = '"', k = n(c), A = n(l), j = n(u), M = n(["end"]), N = n(["do"]), P = n(["on error resume next", "exit"]), F = n(["rem"]);
  function I(e2, t2) {
    t2.currentIndent++;
  }
  function L(e2, t2) {
    t2.currentIndent--;
  }
  function R(e2, n2) {
    if (e2.eatSpace()) return null;
    if (e2.peek() === "'" || e2.match(F)) return e2.skipToEnd(), "comment";
    if (e2.match(/^((&H)|(&O))?[0-9\.]/i, false) && !e2.match(/^((&H)|(&O))?[0-9\.]+[a-z_]/i, false)) {
      var c2 = false;
      if ((e2.match(/^\d*\.\d+/i) || e2.match(/^\d+\.\d*/) || e2.match(/^\.\d+/)) && (c2 = true), c2) return e2.eat(/J/i), "number";
      var l2 = false;
      if (e2.match(/^&H[0-9a-f]+/i) || e2.match(/^&O[0-7]+/i) ? l2 = true : e2.match(/^[1-9]\d*F?/) ? (e2.eat(/J/i), l2 = true) : e2.match(/^0(?![\dx])/i) && (l2 = true), l2) return e2.eat(/L/i), "number";
    }
    return e2.match(O) ? (n2.tokenize = z(e2.current()), n2.tokenize(e2, n2)) : e2.match(i) || e2.match(r) || e2.match(d) ? "operator" : e2.match(a) ? null : e2.match(o) ? "bracket" : e2.match(P) ? (n2.doInCurrentLine = true, "keyword") : e2.match(N) ? (I(e2, n2), n2.doInCurrentLine = true, "keyword") : e2.match(k) ? (n2.doInCurrentLine ? n2.doInCurrentLine = false : I(e2, n2), "keyword") : e2.match(A) ? "keyword" : e2.match(M) ? (L(e2, n2), L(e2, n2), "keyword") : e2.match(j) ? (n2.doInCurrentLine ? n2.doInCurrentLine = false : L(e2, n2), "keyword") : e2.match(C) ? "keyword" : e2.match(w) ? "atom" : e2.match(D) ? "variableName.special" : e2.match(T) || e2.match(E) ? "builtin" : e2.match(s) ? "variable" : (e2.next(), t);
  }
  function z(e2) {
    var t2 = e2.length == 1, n2 = "string";
    return function(r2, i2) {
      for (; !r2.eol(); ) {
        if (r2.eatWhile(/[^'"]/), r2.match(e2)) return i2.tokenize = R, n2;
        r2.eat(/['"]/);
      }
      return t2 && (i2.tokenize = R), n2;
    };
  }
  function B(e2, n2) {
    var r2 = n2.tokenize(e2, n2), i2 = e2.current();
    return i2 === "." ? (r2 = n2.tokenize(e2, n2), i2 = e2.current(), r2 && (r2.substr(0, 8) === "variable" || r2 === "builtin" || r2 === "keyword") ? ((r2 === "builtin" || r2 === "keyword") && (r2 = "variable"), S.indexOf(i2.substr(1)) > -1 && (r2 = "keyword"), r2) : t) : r2;
  }
  return {
    name: "vbscript",
    startState: function() {
      return {
        tokenize: R,
        lastToken: null,
        currentIndent: 0,
        nextLineIndent: 0,
        doInCurrentLine: false,
        ignoreKeyword: false
      };
    },
    token: function(e2, t2) {
      e2.sol() && (t2.currentIndent += t2.nextLineIndent, t2.nextLineIndent = 0, t2.doInCurrentLine = 0);
      var n2 = B(e2, t2);
      return t2.lastToken = {
        style: n2,
        content: e2.current()
      }, n2 === null && (n2 = null), n2;
    },
    indent: function(e2, t2, n2) {
      var r2 = t2.replace(/^\s+|\s+$/g, "");
      return r2.match(j) || r2.match(M) || r2.match(A) ? n2.unit * (e2.currentIndent - 1) : e2.currentIndent < 0 ? 0 : e2.currentIndent * n2.unit;
    }
  };
}
const vbScript = mkVBScript({});
mkVBScript({ isASP: true });
export {
  vbScript as t
};
