(self.webpackChunkRemoteClient = self.webpackChunkRemoteClient || []).push([
  [2274],
  {
    5777: (e, t, r) => {
      'use strict';
      r.d(t, { a: () => s, c: () => n, g: () => a });
      var n =
        'undefined' != typeof globalThis
          ? globalThis
          : 'undefined' != typeof window
          ? window
          : void 0 !== r.g
          ? r.g
          : 'undefined' != typeof self
          ? self
          : {};
      function a(e) {
        return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, 'default')
          ? e.default
          : e;
      }
      function s(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.',
        );
      }
    },
    72274: (e, t, r) => {
      'use strict';
      r.r(t), r.d(t, { WhereClause: () => b, defaultAttributeAdapter: () => D });
      var n = r(76506),
        a = r(40642);
      r(5777), r(71552);
      const s = {
        min: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.min.apply(Math, e[0])),
        },
        max: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.max.apply(Math, e[0])),
        },
        avg: { minParams: 1, maxParams: 1, evaluate: (e) => (null == e[0] ? null : u(e[0])) },
        sum: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) =>
            null == e[0]
              ? null
              : (function (e) {
                  let t = 0;
                  for (let r = 0; r < e.length; r++) t += e[r];
                  return t;
                })(e[0]),
        },
        stddev: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.sqrt(i(e[0]))),
        },
        count: { minParams: 1, maxParams: 1, evaluate: (e) => (null == e[0] ? null : e[0].length) },
        var: { minParams: 1, maxParams: 1, evaluate: (e) => (null == e[0] ? null : i(e[0])) },
      };
      function u(e) {
        let t = 0;
        for (let r = 0; r < e.length; r++) t += e[r];
        return t / e.length;
      }
      function i(e) {
        const t = u(e),
          r = e.length;
        let n = 0;
        for (const r of e) n += (r - t) ** 2;
        return r > 1 ? n / (r - 1) : 0;
      }
      class o {
        constructor() {
          (this.op = '+'),
            (this.day = 0),
            (this.second = 0),
            (this.hour = 0),
            (this.month = 0),
            (this.year = 0),
            (this.minute = 0);
        }
        static fixDefaults(e) {
          if (null !== e.precision || null !== e.secondary)
            throw new Error('Primary and Secondary SqlInterval qualifiers not supported');
        }
        static createFromMilliseconds(e) {
          const t = new o();
          return (t.second = e / 1e3), t;
        }
        static createFromValueAndQualifer(e, t, r) {
          let n = null;
          const a = new o();
          if (((a.op = '-' === r ? '-' : '+'), 'interval-period' === t.type)) {
            o.fixDefaults(t);
            const r = new RegExp('^[0-9]{1,}$');
            if ('year' === t.period || 'month' === t.period)
              throw new Error('Year-Month Intervals not supported');
            if (!r.test(e)) throw new Error('Illegal Interval');
            a[t.period] = parseFloat(e);
          } else {
            if (
              (o.fixDefaults(t.start),
              o.fixDefaults(t.end),
              'year' === t.start.period || 'month' === t.start.period)
            )
              throw new Error('Year-Month Intervals not supported');
            if ('year' === t.end.period || 'month' === t.end.period)
              throw new Error('Year-Month Intervals not supported');
            switch (t.start.period) {
              case 'day':
                switch (t.end.period) {
                  case 'hour':
                    if (((n = new RegExp('^[0-9]{1,} [0-9]{1,}$')), !n.test(e)))
                      throw new Error('Illegal Interval');
                    (a[t.start.period] = parseFloat(e.split(' ')[0])),
                      (a[t.end.period] = parseFloat(e.split(' ')[1]));
                    break;
                  case 'minute':
                    if (((n = new RegExp('^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$')), !n.test(e)))
                      throw new Error('Illegal Interval');
                    {
                      a[t.start.period] = parseFloat(e.split(' ')[0]);
                      const r = e.split(' ')[1].split(':');
                      (a.hour = parseFloat(r[0])), (a.minute = parseFloat(r[1]));
                    }
                    break;
                  case 'second':
                    if (
                      ((n = new RegExp(
                        '^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$',
                      )),
                      !n.test(e))
                    )
                      throw new Error('Illegal Interval');
                    {
                      a[t.start.period] = parseFloat(e.split(' ')[0]);
                      const r = e.split(' ')[1].split(':');
                      (a.hour = parseFloat(r[0])),
                        (a.minute = parseFloat(r[1])),
                        (a.second = parseFloat(r[2]));
                    }
                    break;
                  default:
                    throw 'Invalid Interval.';
                }
                break;
              case 'hour':
                switch (t.end.period) {
                  case 'minute':
                    if (((n = new RegExp('^[0-9]{1,}:[0-9]{1,}$')), !n.test(e)))
                      throw new Error('Illegal Interval');
                    (a.hour = parseFloat(e.split(':')[0])),
                      (a.minute = parseFloat(e.split(':')[1]));
                    break;
                  case 'second':
                    if (
                      ((n = new RegExp('^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$')),
                      !n.test(e))
                    )
                      throw new Error('Illegal Interval');
                    {
                      const t = e.split(':');
                      (a.hour = parseFloat(t[0])),
                        (a.minute = parseFloat(t[1])),
                        (a.second = parseFloat(t[2]));
                    }
                    break;
                  default:
                    throw 'Invalid Interval.';
                }
                break;
              case 'minute':
                switch (t.end.period) {
                  case 'second':
                    if (
                      ((n = new RegExp('^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$')), !n.test(e))
                    )
                      throw new Error('Illegal Interval');
                    {
                      const t = e.split(':');
                      (a.minute = parseFloat(t[0])), (a.second = parseFloat(t[1]));
                    }
                    break;
                  default:
                    throw 'Invalid Interval.';
                }
                break;
              default:
                throw 'Invalid Interval.';
            }
          }
          return a;
        }
        valueInMilliseconds() {
          return (
            ('-' === this.op ? -1 : 1) *
            (1e3 * this.second +
              60 * this.minute * 1e3 +
              60 * this.hour * 60 * 1e3 +
              24 * this.day * 60 * 60 * 1e3 +
              this.month * (365 / 12) * 24 * 60 * 60 * 1e3 +
              365 * this.year * 24 * 60 * 60 * 1e3)
          );
        }
      }
      function l(e, t) {
        const r = c[e.toLowerCase()];
        if (null == r) throw new Error('Function Not Recognised');
        if (t.length < r.minParams || t.length > r.maxParams)
          throw new Error(`Invalid Parameter count for call to ${e.toUpperCase()}`);
        return r.evaluate(t);
      }
      const c = {
        extract: {
          minParams: 2,
          maxParams: 2,
          evaluate: ([e, t]) => {
            if (null == t) return null;
            if (t instanceof Date)
              switch (e.toUpperCase()) {
                case 'SECOND':
                  return t.getSeconds();
                case 'MINUTE':
                  return t.getMinutes();
                case 'HOUR':
                  return t.getHours();
                case 'DAY':
                  return t.getDate();
                case 'MONTH':
                  return t.getMonth() + 1;
                case 'YEAR':
                  return t.getFullYear();
              }
            throw new Error('Invalid Parameter for call to EXTRACT');
          },
        },
        substring: {
          minParams: 2,
          maxParams: 3,
          evaluate: (e) => {
            if (2 === e.length) {
              const [t, r] = e;
              return null == t || null == r ? null : t.toString().substring(r - 1);
            }
            if (3 === e.length) {
              const [t, r, n] = e;
              return null == t || null == r || null == n
                ? null
                : n <= 0
                ? ''
                : t.toString().substring(r - 1, r + n - 1);
            }
          },
        },
        position: {
          minParams: 2,
          maxParams: 2,
          evaluate: ([e, t]) => (null == e || null == t ? null : t.indexOf(e) + 1),
        },
        trim: {
          minParams: 2,
          maxParams: 3,
          evaluate: (e) => {
            const t = 3 === e.length,
              r = t ? e[1] : ' ',
              n = t ? e[2] : e[1];
            if (null == r || null == n) return null;
            const s = `(${(0, a.e)(r)})`;
            switch (e[0]) {
              case 'BOTH':
                return n.replace(new RegExp(`^${s}*|${s}*$`, 'g'), '');
              case 'LEADING':
                return n.replace(new RegExp(`^${s}*`, 'g'), '');
              case 'TRAILING':
                return n.replace(new RegExp(`${s}*$`, 'g'), '');
            }
            throw new Error('Invalid Parameter for call to TRIM');
          },
        },
        abs: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.abs(e[0])),
        },
        ceiling: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.ceil(e[0])),
        },
        floor: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.floor(e[0])),
        },
        log: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.log(e[0])),
        },
        log10: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.log(e[0]) * Math.LOG10E),
        },
        sin: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.sin(e[0])),
        },
        cos: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.cos(e[0])),
        },
        tan: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.tan(e[0])),
        },
        asin: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.asin(e[0])),
        },
        acos: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.acos(e[0])),
        },
        atan: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : Math.atan(e[0])),
        },
        sign: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : e[0] > 0 ? 1 : e[1] < 0 ? -1 : 0),
        },
        power: {
          minParams: 2,
          maxParams: 2,
          evaluate: (e) => (null == e[0] || null == e[1] ? null : e[0] ** e[1]),
        },
        mod: {
          minParams: 2,
          maxParams: 2,
          evaluate: (e) => (null == e[0] || null == e[1] ? null : e[0] % e[1]),
        },
        round: {
          minParams: 1,
          maxParams: 2,
          evaluate: (e) => {
            const t = e[0],
              r = 2 === e.length ? 10 ** e[1] : 1;
            return null == t ? null : Math.round(t * r) / r;
          },
        },
        truncate: {
          minParams: 1,
          maxParams: 2,
          evaluate: (e) =>
            null == e[0]
              ? null
              : 1 === e.length
              ? parseInt(e[0].toFixed(0), 10)
              : parseFloat(e[0].toFixed(e[1])),
        },
        char_length: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => ('string' == typeof e[0] || e[0] instanceof String ? e[0].length : 0),
        },
        concat: {
          minParams: 1,
          maxParams: 1 / 0,
          evaluate: (e) => {
            let t = '';
            for (let r = 0; r < e.length; r++) {
              if (null == e[r]) return null;
              t += e[r].toString();
            }
            return t;
          },
        },
        lower: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : e[0].toString().toLowerCase()),
        },
        upper: {
          minParams: 1,
          maxParams: 1,
          evaluate: (e) => (null == e[0] ? null : e[0].toString().toUpperCase()),
        },
      };
      var p,
        f = { exports: {} };
      (p = f).exports &&
        (p.exports = (function () {
          function e(t, r, n, a) {
            (this.message = t),
              (this.expected = r),
              (this.found = n),
              (this.location = a),
              (this.name = 'SyntaxError'),
              'function' == typeof Error.captureStackTrace && Error.captureStackTrace(this, e);
          }
          return (
            (function (e, t) {
              function r() {
                this.constructor = e;
              }
              (r.prototype = t.prototype), (e.prototype = new r());
            })(e, Error),
            (e.buildMessage = function (e, t) {
              var r = {
                literal: function (e) {
                  return '"' + a(e.text) + '"';
                },
                class: function (e) {
                  var t,
                    r = '';
                  for (t = 0; t < e.parts.length; t++)
                    r +=
                      e.parts[t] instanceof Array
                        ? s(e.parts[t][0]) + '-' + s(e.parts[t][1])
                        : s(e.parts[t]);
                  return '[' + (e.inverted ? '^' : '') + r + ']';
                },
                any: function (e) {
                  return 'any character';
                },
                end: function (e) {
                  return 'end of input';
                },
                other: function (e) {
                  return e.description;
                },
              };
              function n(e) {
                return e.charCodeAt(0).toString(16).toUpperCase();
              }
              function a(e) {
                return e
                  .replace(/\\/g, '\\\\')
                  .replace(/"/g, '\\"')
                  .replace(/\0/g, '\\0')
                  .replace(/\t/g, '\\t')
                  .replace(/\n/g, '\\n')
                  .replace(/\r/g, '\\r')
                  .replace(/[\x00-\x0F]/g, function (e) {
                    return '\\x0' + n(e);
                  })
                  .replace(/[\x10-\x1F\x7F-\x9F]/g, function (e) {
                    return '\\x' + n(e);
                  });
              }
              function s(e) {
                return e
                  .replace(/\\/g, '\\\\')
                  .replace(/\]/g, '\\]')
                  .replace(/\^/g, '\\^')
                  .replace(/-/g, '\\-')
                  .replace(/\0/g, '\\0')
                  .replace(/\t/g, '\\t')
                  .replace(/\n/g, '\\n')
                  .replace(/\r/g, '\\r')
                  .replace(/[\x00-\x0F]/g, function (e) {
                    return '\\x0' + n(e);
                  })
                  .replace(/[\x10-\x1F\x7F-\x9F]/g, function (e) {
                    return '\\x' + n(e);
                  });
              }
              function u(e) {
                return r[e.type](e);
              }
              return (
                'Expected ' +
                (function (e) {
                  var t,
                    r,
                    n = new Array(e.length);
                  for (t = 0; t < e.length; t++) n[t] = u(e[t]);
                  if ((n.sort(), n.length > 0)) {
                    for (t = 1, r = 1; t < n.length; t++) n[t - 1] !== n[t] && ((n[r] = n[t]), r++);
                    n.length = r;
                  }
                  switch (n.length) {
                    case 1:
                      return n[0];
                    case 2:
                      return n[0] + ' or ' + n[1];
                    default:
                      return n.slice(0, -1).join(', ') + ', or ' + n[n.length - 1];
                  }
                })(e) +
                ' but ' +
                (function (e) {
                  return e ? '"' + a(e) + '"' : 'end of input';
                })(t) +
                ' found.'
              );
            }),
            {
              SyntaxError: e,
              parse: function (t, r) {
                r = void 0 !== r ? r : {};
                var n,
                  a = {},
                  s = { start: Ye },
                  u = Ye,
                  i = function (e, t) {
                    return hr(e, t);
                  },
                  o = Ue('!', !1),
                  l = Ue('=', !1),
                  c = Ue('>=', !1),
                  p = Ue('>', !1),
                  f = Ue('<=', !1),
                  v = Ue('<>', !1),
                  h = Ue('<', !1),
                  d = Ue('!=', !1),
                  m = function (e) {
                    return e[0] + ' ' + e[2];
                  },
                  g = Ue('+', !1),
                  w = Ue('-', !1),
                  y = Ue('*', !1),
                  N = Ue('/', !1),
                  b = function (e, t) {
                    return e + t.join('');
                  },
                  T = /^[A-Za-z_\x80-\uFFFF]/,
                  x = He([['A', 'Z'], ['a', 'z'], '_', ['', '']], !1, !1),
                  I = /^[A-Za-z0-9_]/,
                  A = He([['A', 'Z'], ['a', 'z'], ['0', '9'], '_'], !1, !1),
                  E = /^[A-Za-z0-9_.\x80-\uFFFF]/,
                  S = He([['A', 'Z'], ['a', 'z'], ['0', '9'], '_', '.', ['', '']], !1, !1),
                  C = Ue('@', !1),
                  P = function (e) {
                    return {
                      type: 'interval-period',
                      period: e.value,
                      precision: null,
                      secondary: null,
                    };
                  },
                  L = function (e, t) {
                    return {
                      type: 'interval-period',
                      period: 'second',
                      precision: e,
                      secondary: t,
                    };
                  },
                  M = function (e) {
                    return parseFloat(e);
                  },
                  F = Ue("'", !1),
                  O = Ue("N'", !1),
                  _ = "''",
                  R = Ue("''", !1),
                  D = /^[^']/,
                  J = He(["'"], !0, !1),
                  k = function (e, t) {
                    return { type: 'when_clause', operand: e, value: t };
                  },
                  $ = Ue('.', !1),
                  U = /^[0-9]/,
                  H = He([['0', '9']], !1, !1),
                  q = /^[eE]/,
                  V = He(['e', 'E'], !1, !1),
                  B = /^[+\-]/,
                  Y = He(['+', '-'], !1, !1),
                  j = Ue('NULL', !0),
                  z = Ue('TRUE', !0),
                  G = Ue('FALSE', !0),
                  W = Ue('IN', !0),
                  K = Ue('IS', !0),
                  Z = Ue('LIKE', !0),
                  Q = Ue('ESCAPE', !0),
                  X = Ue('NOT', !0),
                  ee = Ue('AND', !0),
                  te = Ue('OR', !0),
                  re = Ue('BETWEEN', !0),
                  ne = Ue('FROM', !0),
                  ae = Ue('FOR', !0),
                  se = Ue('SUBSTRING', !0),
                  ue = Ue('EXTRACT', !0),
                  ie = Ue('TRIM', !0),
                  oe = Ue('POSITION', !0),
                  le = Ue('TIMESTAMP', !0),
                  ce = Ue('DATE', !0),
                  pe = Ue('LEADING', !0),
                  fe = Ue('TRAILING', !0),
                  ve = Ue('BOTH', !0),
                  he = Ue('TO', !0),
                  de = Ue('INTERVAL', !0),
                  me = Ue('YEAR', !0),
                  ge = Ue('MONTH', !0),
                  we = Ue('DAY', !0),
                  ye = Ue('HOUR', !0),
                  Ne = Ue('MINUTE', !0),
                  be = Ue('SECOND', !0),
                  Te = Ue('CASE', !0),
                  xe = Ue('END', !0),
                  Ie = Ue('WHEN', !0),
                  Ae = Ue('THEN', !0),
                  Ee = Ue('ELSE', !0),
                  Se = Ue(',', !1),
                  Ce = Ue('(', !1),
                  Pe = Ue(')', !1),
                  Le = /^[ \t\n\r]/,
                  Me = He([' ', '\t', '\n', '\r'], !1, !1),
                  Fe = Ue('`', !1),
                  Oe = /^[^`]/,
                  _e = He(['`'], !0, !1),
                  Re = 0,
                  De = [{ line: 1, column: 1 }],
                  Je = 0,
                  ke = [],
                  $e = 0;
                if ('startRule' in r) {
                  if (!(r.startRule in s))
                    throw new Error('Can\'t start parsing from rule "' + r.startRule + '".');
                  u = s[r.startRule];
                }
                function Ue(e, t) {
                  return { type: 'literal', text: e, ignoreCase: t };
                }
                function He(e, t, r) {
                  return { type: 'class', parts: e, inverted: t, ignoreCase: r };
                }
                function qe(e) {
                  var r,
                    n = De[e];
                  if (n) return n;
                  for (r = e - 1; !De[r]; ) r--;
                  for (n = { line: (n = De[r]).line, column: n.column }; r < e; )
                    10 === t.charCodeAt(r) ? (n.line++, (n.column = 1)) : n.column++, r++;
                  return (De[e] = n), n;
                }
                function Ve(e, t) {
                  var r = qe(e),
                    n = qe(t);
                  return {
                    start: { offset: e, line: r.line, column: r.column },
                    end: { offset: t, line: n.line, column: n.column },
                  };
                }
                function Be(e) {
                  Re < Je || (Re > Je && ((Je = Re), (ke = [])), ke.push(e));
                }
                function Ye() {
                  var e, t;
                  return (
                    (e = Re),
                    cr() !== a && (t = ze()) !== a && cr() !== a ? (e = t) : ((Re = e), (e = a)),
                    e
                  );
                }
                function je() {
                  var e, t, r, n, s, u, i, o;
                  if (((e = Re), (t = ze()) !== a)) {
                    for (
                      r = [],
                        n = Re,
                        (s = cr()) !== a && (u = ir()) !== a && (i = cr()) !== a && (o = ze()) !== a
                          ? (n = s = [s, u, i, o])
                          : ((Re = n), (n = a));
                      n !== a;

                    )
                      r.push(n),
                        (n = Re),
                        (s = cr()) !== a && (u = ir()) !== a && (i = cr()) !== a && (o = ze()) !== a
                          ? (n = s = [s, u, i, o])
                          : ((Re = n), (n = a));
                    r !== a
                      ? (e = t = (function (e, t) {
                          var r = { type: 'expr_list' },
                            n = (function (e, t, r) {
                              return (function (e, t) {
                                for (var r = [e], n = 0; n < t.length; n++) r.push(t[n][3]);
                                return r;
                              })(e, t);
                            })(e, t);
                          return (r.value = n), r;
                        })(t, r))
                      : ((Re = e), (e = a));
                  } else (Re = e), (e = a);
                  return e;
                }
                function ze() {
                  var e, t, r, n, s, u, o, l;
                  if (((e = Re), (t = Ge()) !== a)) {
                    for (
                      r = [],
                        n = Re,
                        (s = cr()) !== a && (u = Rt()) !== a && (o = cr()) !== a && (l = Ge()) !== a
                          ? (n = s = [s, u, o, l])
                          : ((Re = n), (n = a));
                      n !== a;

                    )
                      r.push(n),
                        (n = Re),
                        (s = cr()) !== a && (u = Rt()) !== a && (o = cr()) !== a && (l = Ge()) !== a
                          ? (n = s = [s, u, o, l])
                          : ((Re = n), (n = a));
                    r !== a ? (e = t = i(t, r)) : ((Re = e), (e = a));
                  } else (Re = e), (e = a);
                  return e;
                }
                function Ge() {
                  var e, t, r, n, s, u, o, l;
                  if (((e = Re), (t = We()) !== a)) {
                    for (
                      r = [],
                        n = Re,
                        (s = cr()) !== a && (u = _t()) !== a && (o = cr()) !== a && (l = We()) !== a
                          ? (n = s = [s, u, o, l])
                          : ((Re = n), (n = a));
                      n !== a;

                    )
                      r.push(n),
                        (n = Re),
                        (s = cr()) !== a && (u = _t()) !== a && (o = cr()) !== a && (l = We()) !== a
                          ? (n = s = [s, u, o, l])
                          : ((Re = n), (n = a));
                    r !== a ? (e = t = i(t, r)) : ((Re = e), (e = a));
                  } else (Re = e), (e = a);
                  return e;
                }
                function We() {
                  var e, r, n, s, u;
                  return (
                    (e = Re),
                    (r = Ot()) === a &&
                      ((r = Re),
                      33 === t.charCodeAt(Re) ? ((n = '!'), Re++) : ((n = a), 0 === $e && Be(o)),
                      n !== a
                        ? ((s = Re),
                          $e++,
                          61 === t.charCodeAt(Re)
                            ? ((u = '='), Re++)
                            : ((u = a), 0 === $e && Be(l)),
                          $e--,
                          u === a ? (s = void 0) : ((Re = s), (s = a)),
                          s !== a ? (r = n = [n, s]) : ((Re = r), (r = a)))
                        : ((Re = r), (r = a))),
                    r !== a && (n = cr()) !== a && (s = We()) !== a
                      ? (e = r = (function (e) {
                          return (function (e, t) {
                            return { type: 'unary_expr', operator: 'NOT', expr: t };
                          })(0, e);
                        })(s))
                      : ((Re = e), (e = a)),
                    e === a &&
                      (e = (function () {
                        var e, t, r;
                        return (
                          (e = Re),
                          (t = Xe()) !== a && cr() !== a
                            ? ((r = (function () {
                                var e;
                                return (
                                  (e = (function () {
                                    var e, t, r, n, s, u;
                                    if (
                                      ((e = []),
                                      (t = Re),
                                      (r = cr()) !== a &&
                                      (n = Ke()) !== a &&
                                      (s = cr()) !== a &&
                                      (u = Xe()) !== a
                                        ? (t = r = [r, n, s, u])
                                        : ((Re = t), (t = a)),
                                      t !== a)
                                    )
                                      for (; t !== a; )
                                        e.push(t),
                                          (t = Re),
                                          (r = cr()) !== a &&
                                          (n = Ke()) !== a &&
                                          (s = cr()) !== a &&
                                          (u = Xe()) !== a
                                            ? (t = r = [r, n, s, u])
                                            : ((Re = t), (t = a));
                                    else e = a;
                                    return (
                                      e !== a &&
                                        (e = (function (e) {
                                          return { type: 'arithmetic', tail: e };
                                        })(e)),
                                      e
                                    );
                                  })()) === a &&
                                    (e = (function () {
                                      var e, t, r, n;
                                      return (
                                        (e = Re),
                                        (t = Qe()) !== a &&
                                        cr() !== a &&
                                        (r = or()) !== a &&
                                        cr() !== a &&
                                        (n = je()) !== a &&
                                        cr() !== a &&
                                        lr() !== a
                                          ? (e = t = (function (e, t) {
                                              return { op: e, right: t };
                                            })(t, n))
                                          : ((Re = e), (e = a)),
                                        e === a &&
                                          ((e = Re),
                                          (t = Qe()) !== a &&
                                          cr() !== a &&
                                          (r = or()) !== a &&
                                          cr() !== a &&
                                          (n = lr()) !== a
                                            ? (e = t = (function (e) {
                                                return {
                                                  op: e,
                                                  right: { type: 'expr_list', value: [] },
                                                };
                                              })(t))
                                            : ((Re = e), (e = a)),
                                          e === a &&
                                            ((e = Re),
                                            (t = Qe()) !== a && cr() !== a && (r = ot()) !== a
                                              ? (e = t = (function (e, t) {
                                                  return { op: e, right: t };
                                                })(t, r))
                                              : ((Re = e), (e = a)))),
                                        e
                                      );
                                    })()) === a &&
                                    (e = (function () {
                                      var e, t, r, n, s, u;
                                      return (
                                        (e = Re),
                                        (t = Ot()) !== a &&
                                        cr() !== a &&
                                        (r = Dt()) !== a &&
                                        cr() !== a &&
                                        (n = Xe()) !== a &&
                                        cr() !== a &&
                                        (s = _t()) !== a &&
                                        cr() !== a &&
                                        (u = Xe()) !== a
                                          ? (e = t = (function (e, t, r) {
                                              return {
                                                op: 'NOT' + e,
                                                right: { type: 'expr_list', value: [t, r] },
                                              };
                                            })(r, n, u))
                                          : ((Re = e), (e = a)),
                                        e === a &&
                                          ((e = Re),
                                          (t = Dt()) !== a &&
                                          cr() !== a &&
                                          (r = Xe()) !== a &&
                                          cr() !== a &&
                                          (n = _t()) !== a &&
                                          cr() !== a &&
                                          (s = Xe()) !== a
                                            ? (e = t = (function (e, t, r) {
                                                return {
                                                  op: e,
                                                  right: { type: 'expr_list', value: [t, r] },
                                                };
                                              })(t, r, s))
                                            : ((Re = e), (e = a))),
                                        e
                                      );
                                    })()) === a &&
                                    (e = (function () {
                                      var e, t, r, n;
                                      return (
                                        (e = Re),
                                        (t = Lt()) !== a &&
                                        cr() !== a &&
                                        (r = Ot()) !== a &&
                                        cr() !== a &&
                                        (n = Xe()) !== a
                                          ? (e = t = (function (e, t) {
                                              return { op: e + 'NOT', right: t };
                                            })(t, n))
                                          : ((Re = e), (e = a)),
                                        e === a &&
                                          ((e = Re),
                                          (t = Lt()) !== a && cr() !== a && (r = Xe()) !== a
                                            ? (e = t = (function (e, t) {
                                                return { op: e, right: t };
                                              })(t, r))
                                            : ((Re = e), (e = a))),
                                        e
                                      );
                                    })()) === a &&
                                    (e = (function () {
                                      var e, t, r, n;
                                      return (
                                        (e = Re),
                                        (t = Ze()) !== a &&
                                        cr() !== a &&
                                        (r = dt()) !== a &&
                                        cr() !== a &&
                                        Ft() !== a &&
                                        cr() !== a &&
                                        (n = mt()) !== a
                                          ? (e = t = (function (e, t, r) {
                                              return { op: e, right: t, escape: r.value };
                                            })(t, r, n))
                                          : ((Re = e), (e = a)),
                                        e === a &&
                                          ((e = Re),
                                          (t = Ze()) !== a && cr() !== a && (r = dt()) !== a
                                            ? (e = t = (function (e, t) {
                                                return { op: e, right: t, escape: '' };
                                              })(t, r))
                                            : ((Re = e), (e = a))),
                                        e
                                      );
                                    })()),
                                  e
                                );
                              })()) === a && (r = null),
                              r !== a
                                ? (e = t = (function (e, t) {
                                    return '' == t || null == t || null == t
                                      ? e
                                      : 'arithmetic' == t.type
                                      ? hr(e, t.tail)
                                      : vr(t.op, e, t.right, t.escape);
                                  })(t, r))
                                : ((Re = e), (e = a)))
                            : ((Re = e), (e = a)),
                          e
                        );
                      })()),
                    e
                  );
                }
                function Ke() {
                  var e;
                  return (
                    '>=' === t.substr(Re, 2)
                      ? ((e = '>='), (Re += 2))
                      : ((e = a), 0 === $e && Be(c)),
                    e === a &&
                      (62 === t.charCodeAt(Re) ? ((e = '>'), Re++) : ((e = a), 0 === $e && Be(p)),
                      e === a &&
                        ('<=' === t.substr(Re, 2)
                          ? ((e = '<='), (Re += 2))
                          : ((e = a), 0 === $e && Be(f)),
                        e === a &&
                          ('<>' === t.substr(Re, 2)
                            ? ((e = '<>'), (Re += 2))
                            : ((e = a), 0 === $e && Be(v)),
                          e === a &&
                            (60 === t.charCodeAt(Re)
                              ? ((e = '<'), Re++)
                              : ((e = a), 0 === $e && Be(h)),
                            e === a &&
                              (61 === t.charCodeAt(Re)
                                ? ((e = '='), Re++)
                                : ((e = a), 0 === $e && Be(l)),
                              e === a &&
                                ('!=' === t.substr(Re, 2)
                                  ? ((e = '!='), (Re += 2))
                                  : ((e = a), 0 === $e && Be(d)))))))),
                    e
                  );
                }
                function Ze() {
                  var e, t, r, n, s;
                  return (
                    (e = Re),
                    (t = Re),
                    (r = Ot()) !== a && (n = cr()) !== a && (s = Mt()) !== a
                      ? (t = r = [r, n, s])
                      : ((Re = t), (t = a)),
                    t !== a && (t = m(t)),
                    (e = t) === a && (e = Mt()),
                    e
                  );
                }
                function Qe() {
                  var e, t, r, n, s;
                  return (
                    (e = Re),
                    (t = Re),
                    (r = Ot()) !== a && (n = cr()) !== a && (s = Pt()) !== a
                      ? (t = r = [r, n, s])
                      : ((Re = t), (t = a)),
                    t !== a && (t = m(t)),
                    (e = t) === a && (e = Pt()),
                    e
                  );
                }
                function Xe() {
                  var e, t, r, n, s, u, o, l;
                  if (((e = Re), (t = tt()) !== a)) {
                    for (
                      r = [],
                        n = Re,
                        (s = cr()) !== a && (u = et()) !== a && (o = cr()) !== a && (l = tt()) !== a
                          ? (n = s = [s, u, o, l])
                          : ((Re = n), (n = a));
                      n !== a;

                    )
                      r.push(n),
                        (n = Re),
                        (s = cr()) !== a && (u = et()) !== a && (o = cr()) !== a && (l = tt()) !== a
                          ? (n = s = [s, u, o, l])
                          : ((Re = n), (n = a));
                    r !== a ? (e = t = i(t, r)) : ((Re = e), (e = a));
                  } else (Re = e), (e = a);
                  return e;
                }
                function et() {
                  var e;
                  return (
                    43 === t.charCodeAt(Re) ? ((e = '+'), Re++) : ((e = a), 0 === $e && Be(g)),
                    e === a &&
                      (45 === t.charCodeAt(Re) ? ((e = '-'), Re++) : ((e = a), 0 === $e && Be(w))),
                    e
                  );
                }
                function tt() {
                  var e, t, r, n, s, u, i, o;
                  if (((e = Re), (t = nt()) !== a)) {
                    for (
                      r = [],
                        n = Re,
                        (s = cr()) !== a && (u = rt()) !== a && (i = cr()) !== a && (o = nt()) !== a
                          ? (n = s = [s, u, i, o])
                          : ((Re = n), (n = a));
                      n !== a;

                    )
                      r.push(n),
                        (n = Re),
                        (s = cr()) !== a && (u = rt()) !== a && (i = cr()) !== a && (o = nt()) !== a
                          ? (n = s = [s, u, i, o])
                          : ((Re = n), (n = a));
                    r !== a
                      ? (e = t = (function (e, t) {
                          return hr(e, t);
                        })(t, r))
                      : ((Re = e), (e = a));
                  } else (Re = e), (e = a);
                  return e;
                }
                function rt() {
                  var e;
                  return (
                    42 === t.charCodeAt(Re) ? ((e = '*'), Re++) : ((e = a), 0 === $e && Be(y)),
                    e === a &&
                      (47 === t.charCodeAt(Re) ? ((e = '/'), Re++) : ((e = a), 0 === $e && Be(N))),
                    e
                  );
                }
                function nt() {
                  var e, t;
                  return (
                    (e = (function () {
                      var e;
                      return (
                        (e = mt()) === a &&
                          (e = (function () {
                            var e, t, r, n;
                            return (
                              (e = Re),
                              (t = (function () {
                                var e, t, r, n;
                                return (
                                  (e = Re),
                                  (t = Nt()) !== a && (r = bt()) !== a && (n = Tt()) !== a
                                    ? (e = t = (function (e, t, r) {
                                        return parseFloat(e + t + r);
                                      })(t, r, n))
                                    : ((Re = e), (e = a)),
                                  e === a &&
                                    ((e = Re),
                                    (t = Nt()) !== a && (r = bt()) !== a
                                      ? (e = t = (function (e, t) {
                                          return parseFloat(e + t);
                                        })(t, r))
                                      : ((Re = e), (e = a)),
                                    e === a &&
                                      ((e = Re),
                                      (t = Nt()) !== a && (r = Tt()) !== a
                                        ? (e = t = (function (e, t) {
                                            return parseFloat(e + t);
                                          })(t, r))
                                        : ((Re = e), (e = a)),
                                      e === a &&
                                        ((e = Re),
                                        (t = Nt()) !== a &&
                                          (t = (function (e) {
                                            return parseFloat(e);
                                          })(t)),
                                        (e = t)))),
                                  e
                                );
                              })()) !== a
                                ? ((r = Re),
                                  $e++,
                                  (n = st()),
                                  $e--,
                                  n === a ? (r = void 0) : ((Re = r), (r = a)),
                                  r !== a
                                    ? (e = t = (function (e) {
                                        return { type: 'number', value: e };
                                      })(t))
                                    : ((Re = e), (e = a)))
                                : ((Re = e), (e = a)),
                              e
                            );
                          })()) === a &&
                          (e = (function () {
                            var e, t;
                            return (
                              (e = Re),
                              (t = St()) !== a && (t = { type: 'bool', value: !0 }),
                              (e = t) === a &&
                                ((e = Re),
                                (t = Ct()) !== a && (t = { type: 'bool', value: !1 }),
                                (e = t)),
                              e
                            );
                          })()) === a &&
                          (e = (function () {
                            var e;
                            return (e = Et()) !== a && (e = { type: 'null', value: null }), e;
                          })()) === a &&
                          (e = (function () {
                            var e, t;
                            return (
                              (e = Re),
                              Bt() !== a && cr() !== a && (t = dt()) !== a
                                ? (e = (function (e) {
                                    return { type: 'date', value: e.value };
                                  })(t))
                                : ((Re = e), (e = a)),
                              e
                            );
                          })()) === a &&
                          (e = (function () {
                            var e, t;
                            return (
                              (e = Re),
                              Vt() !== a && cr() !== a && (t = dt()) !== a
                                ? (e = (function (e) {
                                    return { type: 'timestamp', value: e.value };
                                  })(t))
                                : ((Re = e), (e = a)),
                              e
                            );
                          })()) === a &&
                          (e = ct()),
                        e
                      );
                    })()) === a &&
                      (e = (function () {
                        var e, t, r;
                        return (
                          (e = Re),
                          Ut() !== a &&
                          cr() !== a &&
                          or() !== a &&
                          cr() !== a &&
                          (t = (function () {
                            var e;
                            return (
                              (e = Kt()) === a &&
                                (e = Zt()) === a &&
                                (e = Qt()) === a &&
                                (e = Xt()) === a &&
                                (e = er()) === a &&
                                (e = tr()),
                              e
                            );
                          })()) !== a &&
                          cr() !== a &&
                          Jt() !== a &&
                          cr() !== a &&
                          (r = ze()) !== a &&
                          cr() !== a &&
                          lr() !== a
                            ? (e = (function (e, t) {
                                return {
                                  type: 'function',
                                  name: 'extract',
                                  args: {
                                    type: 'expr_list',
                                    value: [{ type: 'string', value: e }, t],
                                  },
                                };
                              })(t, r))
                            : ((Re = e), (e = a)),
                          e
                        );
                      })()) === a &&
                      (e = (function () {
                        var e, t, r, n, s, u, i, o;
                        return (
                          (e = Re),
                          $t() !== a &&
                          cr() !== a &&
                          or() !== a &&
                          cr() !== a &&
                          (t = ze()) !== a &&
                          cr() !== a &&
                          Jt() !== a &&
                          cr() !== a &&
                          (r = ze()) !== a &&
                          cr() !== a
                            ? ((n = Re),
                              (s = kt()) !== a &&
                              (u = cr()) !== a &&
                              (i = ze()) !== a &&
                              (o = cr()) !== a
                                ? (n = s = [s, u, i, o])
                                : ((Re = n), (n = a)),
                              n === a && (n = null),
                              n !== a && (s = lr()) !== a
                                ? (e = (function (e, t, r) {
                                    return {
                                      type: 'function',
                                      name: 'substring',
                                      args: { type: 'expr_list', value: r ? [e, t, r[2]] : [e, t] },
                                    };
                                  })(t, r, n))
                                : ((Re = e), (e = a)))
                            : ((Re = e), (e = a)),
                          e
                        );
                      })()) === a &&
                      (e = (function () {
                        var e, t, r, n;
                        return (
                          (e = Re),
                          Ht() !== a && cr() !== a && or() !== a && cr() !== a
                            ? ((t = lt()) === a && (t = null),
                              t !== a &&
                              cr() !== a &&
                              (r = ze()) !== a &&
                              cr() !== a &&
                              Jt() !== a &&
                              cr() !== a &&
                              (n = ze()) !== a &&
                              cr() !== a &&
                              lr() !== a
                                ? (e = (function (e, t, r) {
                                    return {
                                      type: 'function',
                                      name: 'trim',
                                      args: {
                                        type: 'expr_list',
                                        value: [
                                          { type: 'string', value: null == e ? 'BOTH' : e },
                                          t,
                                          r,
                                        ],
                                      },
                                    };
                                  })(t, r, n))
                                : ((Re = e), (e = a)))
                            : ((Re = e), (e = a)),
                          e === a &&
                            ((e = Re),
                            Ht() !== a && cr() !== a && or() !== a && cr() !== a
                              ? ((t = lt()) === a && (t = null),
                                t !== a &&
                                cr() !== a &&
                                (r = ze()) !== a &&
                                cr() !== a &&
                                lr() !== a
                                  ? (e = (function (e, t) {
                                      return {
                                        type: 'function',
                                        name: 'trim',
                                        args: {
                                          type: 'expr_list',
                                          value: [
                                            { type: 'string', value: null == e ? 'BOTH' : e },
                                            t,
                                          ],
                                        },
                                      };
                                    })(t, r))
                                  : ((Re = e), (e = a)))
                              : ((Re = e), (e = a))),
                          e
                        );
                      })()) === a &&
                      (e = (function () {
                        var e, t, r;
                        return (
                          (e = Re),
                          qt() !== a &&
                          cr() !== a &&
                          or() !== a &&
                          cr() !== a &&
                          (t = ze()) !== a &&
                          cr() !== a &&
                          Pt() !== a &&
                          cr() !== a &&
                          (r = ze()) !== a &&
                          cr() !== a &&
                          lr() !== a
                            ? (e = (function (e, t) {
                                return {
                                  type: 'function',
                                  name: 'position',
                                  args: { type: 'expr_list', value: [e, t] },
                                };
                              })(t, r))
                            : ((Re = e), (e = a)),
                          e
                        );
                      })()) === a &&
                      (e = (function () {
                        var e, t, r;
                        return (
                          (e = Re),
                          (t = fr()) !== a && cr() !== a && or() !== a && cr() !== a
                            ? ((r = je()) === a && (r = null),
                              r !== a && cr() !== a && lr() !== a
                                ? (e = t = (function (e, t) {
                                    return {
                                      type: 'function',
                                      name: e,
                                      args: t || { type: 'expr_list', value: [] },
                                    };
                                  })(t, r))
                                : ((Re = e), (e = a)))
                            : ((Re = e), (e = a)),
                          e
                        );
                      })()) === a &&
                      (e = (function () {
                        var e;
                        return (
                          (e = (function () {
                            var e, t, r, n, s;
                            if (((e = Re), rr() !== a))
                              if (cr() !== a)
                                if ((t = ze()) !== a)
                                  if (cr() !== a) {
                                    for (r = [], n = wt(); n !== a; ) r.push(n), (n = wt());
                                    r !== a && (n = cr()) !== a && (s = nr()) !== a
                                      ? (e = (function (e, t) {
                                          return {
                                            type: 'case_expression',
                                            format: 'simple',
                                            operand: e,
                                            clauses: t,
                                            else: null,
                                          };
                                        })(t, r))
                                      : ((Re = e), (e = a));
                                  } else (Re = e), (e = a);
                                else (Re = e), (e = a);
                              else (Re = e), (e = a);
                            else (Re = e), (e = a);
                            if (e === a)
                              if (((e = Re), rr() !== a))
                                if (cr() !== a)
                                  if ((t = ze()) !== a)
                                    if (cr() !== a) {
                                      for (r = [], n = wt(); n !== a; ) r.push(n), (n = wt());
                                      r !== a &&
                                      (n = cr()) !== a &&
                                      (s = yt()) !== a &&
                                      cr() !== a &&
                                      nr() !== a
                                        ? (e = (function (e, t, r) {
                                            return {
                                              type: 'case_expression',
                                              format: 'simple',
                                              operand: e,
                                              clauses: t,
                                              else: r.value,
                                            };
                                          })(t, r, s))
                                        : ((Re = e), (e = a));
                                    } else (Re = e), (e = a);
                                  else (Re = e), (e = a);
                                else (Re = e), (e = a);
                              else (Re = e), (e = a);
                            return e;
                          })()) === a &&
                            (e = (function () {
                              var e, t, r, n;
                              if (((e = Re), rr() !== a))
                                if (cr() !== a) {
                                  for (t = [], r = gt(); r !== a; ) t.push(r), (r = gt());
                                  t !== a && (r = cr()) !== a && (n = nr()) !== a
                                    ? (e = (function (e) {
                                        return {
                                          type: 'case_expression',
                                          format: 'searched',
                                          clauses: e,
                                          else: null,
                                        };
                                      })(t))
                                    : ((Re = e), (e = a));
                                } else (Re = e), (e = a);
                              else (Re = e), (e = a);
                              if (e === a)
                                if (((e = Re), rr() !== a))
                                  if (cr() !== a) {
                                    for (t = [], r = gt(); r !== a; ) t.push(r), (r = gt());
                                    t !== a &&
                                    (r = cr()) !== a &&
                                    (n = yt()) !== a &&
                                    cr() !== a &&
                                    nr() !== a
                                      ? (e = (function (e, t) {
                                          return {
                                            type: 'case_expression',
                                            format: 'searched',
                                            clauses: e,
                                            else: t.value,
                                          };
                                        })(t, n))
                                      : ((Re = e), (e = a));
                                  } else (Re = e), (e = a);
                                else (Re = e), (e = a);
                              return e;
                            })()),
                          e
                        );
                      })()) === a &&
                      (e = (function () {
                        var e;
                        return (
                          (e = (function () {
                            var e;
                            return (
                              (e = (function () {
                                var e, t, r, n;
                                if (((e = Re), (t = st()) !== a)) {
                                  for (r = [], n = it(); n !== a; ) r.push(n), (n = it());
                                  r !== a ? (e = t = b(t, r)) : ((Re = e), (e = a));
                                } else (Re = e), (e = a);
                                return e;
                              })()) !== a && (e = e),
                              e
                            );
                          })()) !== a &&
                            (e = (function (e) {
                              return /^CURRENT_DATE$/i.test(e)
                                ? { type: 'current_time', mode: 'date' }
                                : /^CURRENT_TIMESTAMP$/i.test(e)
                                ? { type: 'current_time', mode: 'timestamp' }
                                : { type: 'column_ref', table: '', column: e };
                            })(e)),
                          e
                        );
                      })()) === a &&
                      (e = ot()) === a &&
                      ((e = Re),
                      or() !== a && cr() !== a && (t = ze()) !== a && cr() !== a && lr() !== a
                        ? (e = (function (e) {
                            return (e.paren = !0), e;
                          })(t))
                        : ((Re = e), (e = a))),
                    e
                  );
                }
                function at() {
                  var e, t, r, n;
                  if (((e = Re), (t = st()) !== a)) {
                    for (r = [], n = ut(); n !== a; ) r.push(n), (n = ut());
                    r !== a ? (e = t = b(t, r)) : ((Re = e), (e = a));
                  } else (Re = e), (e = a);
                  return e;
                }
                function st() {
                  var e;
                  return (
                    T.test(t.charAt(Re))
                      ? ((e = t.charAt(Re)), Re++)
                      : ((e = a), 0 === $e && Be(x)),
                    e
                  );
                }
                function ut() {
                  var e;
                  return (
                    I.test(t.charAt(Re))
                      ? ((e = t.charAt(Re)), Re++)
                      : ((e = a), 0 === $e && Be(A)),
                    e
                  );
                }
                function it() {
                  var e;
                  return (
                    E.test(t.charAt(Re))
                      ? ((e = t.charAt(Re)), Re++)
                      : ((e = a), 0 === $e && Be(S)),
                    e
                  );
                }
                function ot() {
                  var e, r, n;
                  return (
                    (e = Re),
                    64 === t.charCodeAt(Re) ? ((r = '@'), Re++) : ((r = a), 0 === $e && Be(C)),
                    r !== a && (n = at()) !== a ? (e = r = [r, n]) : ((Re = e), (e = a)),
                    e !== a &&
                      (e = (function (e) {
                        return { type: 'param', value: e[1] };
                      })(e)),
                    e
                  );
                }
                function lt() {
                  var e;
                  return (e = Yt()) === a && (e = jt()) === a && (e = zt()), e;
                }
                function ct() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    Wt() !== a && cr() !== a
                      ? (45 === t.charCodeAt(Re) ? ((r = '-'), Re++) : ((r = a), 0 === $e && Be(w)),
                        r === a &&
                          (43 === t.charCodeAt(Re)
                            ? ((r = '+'), Re++)
                            : ((r = a), 0 === $e && Be(g))),
                        r !== a && cr() !== a && (n = dt()) !== a && cr() !== a && (s = pt()) !== a
                          ? (e = (function (e, t, r) {
                              return { type: 'interval', value: t, qualifier: r, op: e };
                            })(r, n, s))
                          : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e === a &&
                      ((e = Re),
                      Wt() !== a && cr() !== a && (r = dt()) !== a && cr() !== a && (n = pt()) !== a
                        ? (e = (function (e, t) {
                            return { type: 'interval', value: e, qualifier: t, op: '' };
                          })(r, n))
                        : ((Re = e), (e = a))),
                    e
                  );
                }
                function pt() {
                  var e, t, r;
                  return (
                    (e = Re),
                    (t = (function () {
                      var e, t, r;
                      return (
                        (e = Re),
                        (t = ft()) !== a &&
                        cr() !== a &&
                        or() !== a &&
                        cr() !== a &&
                        (r = ht()) !== a &&
                        cr() !== a &&
                        lr() !== a
                          ? (e = t = (function (e, t) {
                              return {
                                type: 'interval-period',
                                period: e.value,
                                precision: t,
                                secondary: null,
                              };
                            })(t, r))
                          : ((Re = e), (e = a)),
                        e === a && ((e = Re), (t = ft()) !== a && (t = P(t)), (e = t)),
                        e
                      );
                    })()) !== a &&
                    cr() !== a &&
                    Gt() !== a &&
                    cr() !== a &&
                    (r = (function () {
                      var e, t, r, n;
                      return (
                        (e = Re),
                        (t = ft()) !== a &&
                          (t = (function (e) {
                            return {
                              type: 'interval-period',
                              period: e.value,
                              precision: null,
                              secondary: null,
                            };
                          })(t)),
                        (e = t) === a &&
                          ((e = Re),
                          (t = tr()) !== a &&
                          cr() !== a &&
                          or() !== a &&
                          cr() !== a &&
                          (r = ht()) !== a &&
                          cr() !== a &&
                          ir() !== a &&
                          cr() !== a &&
                          (n = vt()) !== a &&
                          cr() !== a &&
                          lr() !== a
                            ? (e = t = L(r, n))
                            : ((Re = e), (e = a)),
                          e === a &&
                            ((e = Re),
                            (t = tr()) !== a &&
                            cr() !== a &&
                            or() !== a &&
                            cr() !== a &&
                            (r = ht()) !== a &&
                            cr() !== a &&
                            lr() !== a
                              ? (e = t = (function (e) {
                                  return {
                                    type: 'interval-period',
                                    period: 'second',
                                    precision: e,
                                    secondary: null,
                                  };
                                })(r))
                              : ((Re = e), (e = a)),
                            e === a &&
                              ((e = Re),
                              (t = tr()) !== a &&
                                (t = {
                                  type: 'interval-period',
                                  period: 'second',
                                  precision: null,
                                  secondary: null,
                                }),
                              (e = t)))),
                        e
                      );
                    })()) !== a
                      ? (e = t = (function (e, t) {
                          return { type: 'interval-qualifier', start: e, end: t };
                        })(t, r))
                      : ((Re = e), (e = a)),
                    e === a &&
                      (e = (function () {
                        var e, t, r, n;
                        return (
                          (e = Re),
                          (t = ft()) !== a &&
                          cr() !== a &&
                          or() !== a &&
                          cr() !== a &&
                          (r = vt()) !== a &&
                          cr() !== a &&
                          lr() !== a
                            ? (e = t = (function (e, t) {
                                return {
                                  type: 'interval-period',
                                  period: e.value,
                                  precision: t,
                                  secondary: null,
                                };
                              })(t, r))
                            : ((Re = e), (e = a)),
                          e === a &&
                            ((e = Re),
                            (t = ft()) !== a && (t = P(t)),
                            (e = t) === a &&
                              ((e = Re),
                              (t = tr()) !== a &&
                              cr() !== a &&
                              or() !== a &&
                              cr() !== a &&
                              (r = ht()) !== a &&
                              cr() !== a &&
                              ir() !== a &&
                              cr() !== a &&
                              (n = vt()) !== a &&
                              cr() !== a &&
                              lr() !== a
                                ? (e = t = L(r, n))
                                : ((Re = e), (e = a)),
                              e === a &&
                                ((e = Re),
                                (t = tr()) !== a &&
                                cr() !== a &&
                                or() !== a &&
                                cr() !== a &&
                                (r = vt()) !== a &&
                                cr() !== a &&
                                lr() !== a
                                  ? (e = t = (function (e) {
                                      return {
                                        type: 'interval-period',
                                        period: 'second',
                                        precision: e,
                                        secondary: null,
                                      };
                                    })(r))
                                  : ((Re = e), (e = a)),
                                e === a &&
                                  ((e = Re),
                                  (t = tr()) !== a &&
                                    (t = {
                                      type: 'interval-period',
                                      period: 'second',
                                      precision: null,
                                      secondary: null,
                                    }),
                                  (e = t))))),
                          e
                        );
                      })()),
                    e
                  );
                }
                function ft() {
                  var e, t;
                  return (
                    (e = Re),
                    (t = Qt()) !== a && (t = { type: 'string', value: 'day' }),
                    (e = t) === a &&
                      ((e = Re),
                      (t = Xt()) !== a && (t = { type: 'string', value: 'hour' }),
                      (e = t) === a &&
                        ((e = Re),
                        (t = er()) !== a && (t = { type: 'string', value: 'minute' }),
                        (e = t) === a &&
                          ((e = Re),
                          (t = Zt()) !== a && (t = { type: 'string', value: 'month' }),
                          (e = t) === a &&
                            ((e = Re),
                            (t = Kt()) !== a && (t = { type: 'string', value: 'year' }),
                            (e = t))))),
                    e
                  );
                }
                function vt() {
                  var e;
                  return (e = xt()) !== a && (e = M(e)), e;
                }
                function ht() {
                  var e;
                  return (e = xt()) !== a && (e = M(e)), e;
                }
                function dt() {
                  var e;
                  return (e = mt()) === a && (e = ot()), e;
                }
                function mt() {
                  var e, r, n, s, u;
                  if (
                    ((e = Re),
                    39 === t.charCodeAt(Re) ? ((r = "'"), Re++) : ((r = a), 0 === $e && Be(F)),
                    r === a &&
                      ("N'" === t.substr(Re, 2)
                        ? ((r = "N'"), (Re += 2))
                        : ((r = a), 0 === $e && Be(O))),
                    r !== a)
                  ) {
                    for (
                      n = [],
                        s = Re,
                        t.substr(Re, 2) === _ ? ((u = _), (Re += 2)) : ((u = a), 0 === $e && Be(R)),
                        u !== a && (u = "'"),
                        (s = u) === a &&
                          (D.test(t.charAt(Re))
                            ? ((s = t.charAt(Re)), Re++)
                            : ((s = a), 0 === $e && Be(J)));
                      s !== a;

                    )
                      n.push(s),
                        (s = Re),
                        t.substr(Re, 2) === _ ? ((u = _), (Re += 2)) : ((u = a), 0 === $e && Be(R)),
                        u !== a && (u = "'"),
                        (s = u) === a &&
                          (D.test(t.charAt(Re))
                            ? ((s = t.charAt(Re)), Re++)
                            : ((s = a), 0 === $e && Be(J)));
                    n !== a
                      ? (39 === t.charCodeAt(Re) ? ((s = "'"), Re++) : ((s = a), 0 === $e && Be(F)),
                        s !== a
                          ? (e = r = (function (e) {
                              return { type: 'string', value: e.join('') };
                            })(n))
                          : ((Re = e), (e = a)))
                      : ((Re = e), (e = a));
                  } else (Re = e), (e = a);
                  return e;
                }
                function gt() {
                  var e, t, r;
                  return (
                    (e = Re),
                    ar() !== a &&
                    cr() !== a &&
                    (t = ze()) !== a &&
                    cr() !== a &&
                    sr() !== a &&
                    cr() !== a &&
                    (r = ze()) !== a
                      ? (e = k(t, r))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function wt() {
                  var e, t, r;
                  return (
                    (e = Re),
                    ar() !== a &&
                    cr() !== a &&
                    (t = ze()) !== a &&
                    cr() !== a &&
                    sr() !== a &&
                    cr() !== a &&
                    (r = ze()) !== a
                      ? (e = k(t, r))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function yt() {
                  var e, t;
                  return (
                    (e = Re),
                    ur() !== a && cr() !== a && (t = ze()) !== a
                      ? (e = (function (e) {
                          return { type: 'else_clause', value: e };
                        })(t))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Nt() {
                  var e, r, n;
                  return (
                    (e = xt()) === a &&
                      ((e = Re),
                      45 === t.charCodeAt(Re) ? ((r = '-'), Re++) : ((r = a), 0 === $e && Be(w)),
                      r === a &&
                        (43 === t.charCodeAt(Re)
                          ? ((r = '+'), Re++)
                          : ((r = a), 0 === $e && Be(g))),
                      r !== a && (n = xt()) !== a
                        ? (e = r = (function (e, t) {
                            return e[0] + t;
                          })(r, n))
                        : ((Re = e), (e = a))),
                    e
                  );
                }
                function bt() {
                  var e, r, n;
                  return (
                    (e = Re),
                    46 === t.charCodeAt(Re) ? ((r = '.'), Re++) : ((r = a), 0 === $e && Be($)),
                    r !== a
                      ? ((n = xt()) === a && (n = null),
                        n !== a
                          ? (e = r = (function (e) {
                              return '.' + (null != e ? e : '');
                            })(n))
                          : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Tt() {
                  var e, t, r;
                  return (
                    (e = Re),
                    (t = At()) !== a && (r = xt()) !== a
                      ? (e = t = (function (e, t) {
                          return e + t;
                        })(t, r))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function xt() {
                  var e, t;
                  if (((e = []), (t = It()) !== a)) for (; t !== a; ) e.push(t), (t = It());
                  else e = a;
                  return (
                    e !== a &&
                      (e = (function (e) {
                        return e.join('');
                      })(e)),
                    e
                  );
                }
                function It() {
                  var e;
                  return (
                    U.test(t.charAt(Re))
                      ? ((e = t.charAt(Re)), Re++)
                      : ((e = a), 0 === $e && Be(H)),
                    e
                  );
                }
                function At() {
                  var e, r, n;
                  return (
                    (e = Re),
                    q.test(t.charAt(Re))
                      ? ((r = t.charAt(Re)), Re++)
                      : ((r = a), 0 === $e && Be(V)),
                    r !== a
                      ? (B.test(t.charAt(Re))
                          ? ((n = t.charAt(Re)), Re++)
                          : ((n = a), 0 === $e && Be(Y)),
                        n === a && (n = null),
                        n !== a
                          ? (e = r = (function (e, t) {
                              return 'e' + (null === t ? '' : t);
                            })(0, n))
                          : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Et() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'null' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(j)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = [r, n]) : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function St() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'true' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(z)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = [r, n]) : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Ct() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'false' === t.substr(Re, 5).toLowerCase()
                      ? ((r = t.substr(Re, 5)), (Re += 5))
                      : ((r = a), 0 === $e && Be(G)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = [r, n]) : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Pt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'in' === t.substr(Re, 2).toLowerCase()
                      ? ((r = t.substr(Re, 2)), (Re += 2))
                      : ((r = a), 0 === $e && Be(W)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'IN') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Lt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'is' === t.substr(Re, 2).toLowerCase()
                      ? ((r = t.substr(Re, 2)), (Re += 2))
                      : ((r = a), 0 === $e && Be(K)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'IS') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Mt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'like' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(Z)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'LIKE') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Ft() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'escape' === t.substr(Re, 6).toLowerCase()
                      ? ((r = t.substr(Re, 6)), (Re += 6))
                      : ((r = a), 0 === $e && Be(Q)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'ESCAPE') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Ot() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'not' === t.substr(Re, 3).toLowerCase()
                      ? ((r = t.substr(Re, 3)), (Re += 3))
                      : ((r = a), 0 === $e && Be(X)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'NOT') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function _t() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'and' === t.substr(Re, 3).toLowerCase()
                      ? ((r = t.substr(Re, 3)), (Re += 3))
                      : ((r = a), 0 === $e && Be(ee)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'AND') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Rt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'or' === t.substr(Re, 2).toLowerCase()
                      ? ((r = t.substr(Re, 2)), (Re += 2))
                      : ((r = a), 0 === $e && Be(te)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'OR') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Dt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'between' === t.substr(Re, 7).toLowerCase()
                      ? ((r = t.substr(Re, 7)), (Re += 7))
                      : ((r = a), 0 === $e && Be(re)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'BETWEEN') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Jt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'from' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(ne)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'FROM') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function kt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'for' === t.substr(Re, 3).toLowerCase()
                      ? ((r = t.substr(Re, 3)), (Re += 3))
                      : ((r = a), 0 === $e && Be(ae)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'FOR') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function $t() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'substring' === t.substr(Re, 9).toLowerCase()
                      ? ((r = t.substr(Re, 9)), (Re += 9))
                      : ((r = a), 0 === $e && Be(se)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'SUBSTRING') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Ut() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'extract' === t.substr(Re, 7).toLowerCase()
                      ? ((r = t.substr(Re, 7)), (Re += 7))
                      : ((r = a), 0 === $e && Be(ue)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'EXTRACT') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Ht() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'trim' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(ie)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'TRIM') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function qt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'position' === t.substr(Re, 8).toLowerCase()
                      ? ((r = t.substr(Re, 8)), (Re += 8))
                      : ((r = a), 0 === $e && Be(oe)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'POSITION') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Vt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'timestamp' === t.substr(Re, 9).toLowerCase()
                      ? ((r = t.substr(Re, 9)), (Re += 9))
                      : ((r = a), 0 === $e && Be(le)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'TIMESTAMP') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Bt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'date' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(ce)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'DATE') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Yt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'leading' === t.substr(Re, 7).toLowerCase()
                      ? ((r = t.substr(Re, 7)), (Re += 7))
                      : ((r = a), 0 === $e && Be(pe)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'LEADING') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function jt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'trailing' === t.substr(Re, 8).toLowerCase()
                      ? ((r = t.substr(Re, 8)), (Re += 8))
                      : ((r = a), 0 === $e && Be(fe)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'TRAILING') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function zt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'both' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(ve)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'BOTH') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Gt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'to' === t.substr(Re, 2).toLowerCase()
                      ? ((r = t.substr(Re, 2)), (Re += 2))
                      : ((r = a), 0 === $e && Be(he)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'TO') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Wt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'interval' === t.substr(Re, 8).toLowerCase()
                      ? ((r = t.substr(Re, 8)), (Re += 8))
                      : ((r = a), 0 === $e && Be(de)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'INTERVAL') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Kt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'year' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(me)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'YEAR') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Zt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'month' === t.substr(Re, 5).toLowerCase()
                      ? ((r = t.substr(Re, 5)), (Re += 5))
                      : ((r = a), 0 === $e && Be(ge)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'MONTH') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Qt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'day' === t.substr(Re, 3).toLowerCase()
                      ? ((r = t.substr(Re, 3)), (Re += 3))
                      : ((r = a), 0 === $e && Be(we)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'DAY') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function Xt() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'hour' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(ye)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'HOUR') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function er() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'minute' === t.substr(Re, 6).toLowerCase()
                      ? ((r = t.substr(Re, 6)), (Re += 6))
                      : ((r = a), 0 === $e && Be(Ne)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'MINUTE') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function tr() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'second' === t.substr(Re, 6).toLowerCase()
                      ? ((r = t.substr(Re, 6)), (Re += 6))
                      : ((r = a), 0 === $e && Be(be)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'SECOND') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function rr() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'case' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(Te)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'CASE') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function nr() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'end' === t.substr(Re, 3).toLowerCase()
                      ? ((r = t.substr(Re, 3)), (Re += 3))
                      : ((r = a), 0 === $e && Be(xe)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'END') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function ar() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'when' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(Ie)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'WHEN') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function sr() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'then' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(Ae)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'THEN') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function ur() {
                  var e, r, n, s;
                  return (
                    (e = Re),
                    'else' === t.substr(Re, 4).toLowerCase()
                      ? ((r = t.substr(Re, 4)), (Re += 4))
                      : ((r = a), 0 === $e && Be(Ee)),
                    r !== a
                      ? ((n = Re),
                        $e++,
                        (s = ut()),
                        $e--,
                        s === a ? (n = void 0) : ((Re = n), (n = a)),
                        n !== a ? (e = r = 'ELSE') : ((Re = e), (e = a)))
                      : ((Re = e), (e = a)),
                    e
                  );
                }
                function ir() {
                  var e;
                  return (
                    44 === t.charCodeAt(Re) ? ((e = ','), Re++) : ((e = a), 0 === $e && Be(Se)), e
                  );
                }
                function or() {
                  var e;
                  return (
                    40 === t.charCodeAt(Re) ? ((e = '('), Re++) : ((e = a), 0 === $e && Be(Ce)), e
                  );
                }
                function lr() {
                  var e;
                  return (
                    41 === t.charCodeAt(Re) ? ((e = ')'), Re++) : ((e = a), 0 === $e && Be(Pe)), e
                  );
                }
                function cr() {
                  var e, t;
                  for (e = [], t = pr(); t !== a; ) e.push(t), (t = pr());
                  return e;
                }
                function pr() {
                  var e;
                  return (
                    Le.test(t.charAt(Re))
                      ? ((e = t.charAt(Re)), Re++)
                      : ((e = a), 0 === $e && Be(Me)),
                    e
                  );
                }
                function fr() {
                  var e, r, n, s;
                  if (((e = Re), (r = at()) !== a && (r = r), (e = r) === a))
                    if (
                      ((e = Re),
                      96 === t.charCodeAt(Re) ? ((r = '`'), Re++) : ((r = a), 0 === $e && Be(Fe)),
                      r !== a)
                    ) {
                      if (
                        ((n = []),
                        Oe.test(t.charAt(Re))
                          ? ((s = t.charAt(Re)), Re++)
                          : ((s = a), 0 === $e && Be(_e)),
                        s !== a)
                      )
                        for (; s !== a; )
                          n.push(s),
                            Oe.test(t.charAt(Re))
                              ? ((s = t.charAt(Re)), Re++)
                              : ((s = a), 0 === $e && Be(_e));
                      else n = a;
                      n !== a
                        ? (96 === t.charCodeAt(Re)
                            ? ((s = '`'), Re++)
                            : ((s = a), 0 === $e && Be(Fe)),
                          s !== a
                            ? (e = r = (function (e) {
                                return e.join('');
                              })(n))
                            : ((Re = e), (e = a)))
                        : ((Re = e), (e = a));
                    } else (Re = e), (e = a);
                  return e;
                }
                function vr(e, t, r, n) {
                  var a = { type: 'binary_expr', operator: e, left: t, right: r };
                  return void 0 !== n && (a.escape = n), a;
                }
                function hr(e, t) {
                  for (var r = e, n = 0; n < t.length; n++) r = vr(t[n][1], r, t[n][3]);
                  return r;
                }
                if ((n = u()) !== a && Re === t.length) return n;
                throw (
                  (n !== a && Re < t.length && Be({ type: 'end' }),
                  (function (t, r, n) {
                    return new e(e.buildMessage(t, r), t, r, n);
                  })(
                    ke,
                    Je < t.length ? t.charAt(Je) : null,
                    Je < t.length ? Ve(Je, Je + 1) : Ve(Je, Je),
                  ))
                );
              },
            }
          );
        })());
      const v = /^(\d{4})-(\d{1,2})-(\d{1,2})$/,
        h = /^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2}(\.[0-9]+)?)$/,
        d = /^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2}):(\d{1,2}(\.[0-9]+)?)(\+|\-)(\d{1,2}):(\d{1,2})$/,
        m = /^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})(\+|\-)(\d{1,2}):(\d{1,2})$/,
        g = /^(\d{4})-(\d{1,2})-(\d{1,2}) (\d{1,2}):(\d{1,2})$/;
      function w(e, t) {
        return (e += '').length >= t ? e : new Array(t - e.length + 1).join('0') + e;
      }
      function y(e, t, r = '0', n = '0', a = '0', s = '0', u = '', i = '0', o = '0') {
        if ('+' === u || '-' === u) {
          const l = `${w(parseInt(e, 10), 4)}-${w(parseInt(t, 10), 2)}-${w(parseInt(r, 10), 2)}`;
          let c = '';
          parseFloat(s) < 10 && (c = '0');
          const p = `${w(parseInt(n, 10), 2)}:${w(parseInt(a, 10), 2)}:${
              c + parseFloat(s).toString()
            }`,
            f = `${u}${w(parseInt(i, 10), 2)}:${w(parseInt(o, 10), 2)}`;
          return new Date(l + 'T' + p + f);
        }
        return new Date(
          parseInt(e, 10),
          parseInt(t, 10) - 1,
          parseInt(r, 10),
          parseInt(n, 10),
          parseInt(a, 10),
          parseFloat(s),
        );
      }
      class N {
        static makeBool(e) {
          return I(e);
        }
        static featureValue(e, t, r, n) {
          return R(e, t, r, n);
        }
        static equalsNull(e) {
          return null === e;
        }
        static applyLike(e, t, r) {
          return L(e, t, r);
        }
        static ensureArray(e) {
          return A(e);
        }
        static applyIn(e, t) {
          return P(e, t);
        }
        static currentDate() {
          const e = new Date();
          return e.setHours(0, 0, 0, 0), e;
        }
        static makeSqlInterval(e, t, r) {
          return o.createFromValueAndQualifer(e, t, r);
        }
        static convertInterval(e) {
          return e instanceof o ? e.valueInMilliseconds() : e;
        }
        static currentTimestamp() {
          return new Date();
        }
        static compare(e, t, r) {
          return F(e, t, r);
        }
        static calculate(e, t, r) {
          return _(e, t, r);
        }
        static makeComparable(e) {
          return M(e);
        }
        static evaluateFunction(e, t) {
          return l(e, t);
        }
        static lookup(e, t) {
          const r = t[e];
          return void 0 === r ? null : r;
        }
        static between(e, t) {
          return null == e || null == t[0] || null == t[1] ? null : e >= t[0] && e <= t[1];
        }
        static notbetween(e, t) {
          return null == e || null == t[0] || null == t[1] ? null : e < t[0] || e > t[1];
        }
        static ternaryNot(e) {
          return E(e);
        }
        static ternaryAnd(e, t) {
          return S(e, t);
        }
        static ternaryOr(e, t) {
          return C(e, t);
        }
      }
      class b {
        constructor(e, t) {
          (this.fieldsIndex = t),
            (this.datefields = {}),
            (this.parameters = {}),
            (this.parseTree = class {
              static parse(e) {
                return f.exports.parse(e);
              }
            }.parse(e));
          const {
            isStandardized: r,
            isAggregate: n,
            referencedFieldNames: a,
          } = this.extractExpressionInfo(t);
          (this.referencedFieldNames = a), (this.isStandardized = r), (this.isAggregate = n);
        }
        static create(e, t) {
          return new b(e, t);
        }
        get fieldNames() {
          return this.referencedFieldNames;
        }
        testSet(e, t = D) {
          const r = {};
          for (const n of this.fieldNames) r[n] = e.map((e) => t.getAttribute(e, n));
          return !!this.evaluateNode(this.parseTree, { attributes: r }, D);
        }
        calculateValue(e, t = D) {
          const r = this.evaluateNode(this.parseTree, e, t);
          return r instanceof o ? r.valueInMilliseconds() / 864e5 : r;
        }
        calculateValueCompiled(e, t = D) {
          return null != this.parseTree._compiledVersion
            ? this.parseTree._compiledVersion(e, this.parameters, t, this.datefields)
            : (0, n.h)('csp-restrictions')
            ? this.calculateValue(e, t)
            : (this.compileMe(),
              this.parseTree._compiledVersion(e, this.parameters, t, this.datefields));
        }
        testFeature(e, t = D) {
          return !!this.evaluateNode(this.parseTree, e, t);
        }
        testFeatureCompiled(e, t = D) {
          return null != this.parseTree._compiledVersion
            ? !!this.parseTree._compiledVersion(e, this.parameters, t, this.datefields)
            : (0, n.h)('csp-restrictions')
            ? this.testFeature(e, t)
            : (this.compileMe(),
              !!this.parseTree._compiledVersion(e, this.parameters, t, this.datefields));
        }
        getFunctions() {
          const e = [];
          return (
            this.visitAll(this.parseTree, (t) => {
              'function' === t.type && e.push(t.name.toLowerCase());
            }),
            O(e)
          );
        }
        getExpressions() {
          const e = new Map();
          return (
            this.visitAll(this.parseTree, (t) => {
              if ('function' === t.type) {
                const r = t.name.toLowerCase(),
                  n = t.args.value[0];
                if ('column_ref' === n.type) {
                  const t = n.column,
                    a = `${r}-${t}`;
                  e.has(a) || e.set(a, { aggregateType: r, field: t });
                }
              }
            }),
            [...e.values()]
          );
        }
        getVariables() {
          const e = [];
          return (
            this.visitAll(this.parseTree, (t) => {
              'param' === t.type && e.push(t.value.toLowerCase());
            }),
            O(e)
          );
        }
        compileMe() {
          const e =
            'return this.convertInterval(' + this.evaluateNodeToJavaScript(this.parseTree) + ')';
          this.parseTree._compiledVersion = new Function(
            'feature',
            'lookups',
            'attributeAdapter',
            'datefields',
            e,
          ).bind(N);
        }
        extractExpressionInfo(e) {
          const t = [];
          let r = !0,
            n = !0;
          return (
            this.visitAll(this.parseTree, (a) => {
              switch (a.type) {
                case 'column_ref': {
                  const r = e.get(a.column),
                    n = r && r.name;
                  !r ||
                    ('date' !== r.type && 'esriFieldTypeDate' !== r.type) ||
                    (this.datefields[r.name] = 1),
                    void 0 !== n ? (t.push(n), (a.column = n)) : t.push(a.column);
                  break;
                }
                case 'function': {
                  const { name: e, args: t } = a,
                    u = t.value.length;
                  r &&
                    (r = (function (e, t) {
                      const r = c[e.toLowerCase()];
                      return null != r && t >= r.minParams && t <= r.maxParams;
                    })(e, u)),
                    n &&
                      (n = (function (e, t) {
                        const r = s[e.toLowerCase()];
                        return null != r && t >= r.minParams && t <= r.maxParams;
                      })(e, u));
                  break;
                }
              }
            }),
            { referencedFieldNames: O(t), isStandardized: r, isAggregate: n }
          );
        }
        visitAll(e, t) {
          if (null != e)
            switch ((t(e), e.type)) {
              case 'when_clause':
                this.visitAll(e.operand, t), this.visitAll(e.value, t);
                break;
              case 'case_expression':
                for (const r of e.clauses) this.visitAll(r, t);
                'simple' === e.format && this.visitAll(e.operand, t),
                  null !== e.else && this.visitAll(e.else, t);
                break;
              case 'expr_list':
                for (const r of e.value) this.visitAll(r, t);
                break;
              case 'unary_expr':
                this.visitAll(e.expr, t);
                break;
              case 'binary_expr':
                this.visitAll(e.left, t), this.visitAll(e.right, t);
                break;
              case 'function':
                this.visitAll(e.args, t);
            }
        }
        evaluateNodeToJavaScript(e) {
          switch (e.type) {
            case 'interval':
              return (
                'this.makeSqlInterval(' +
                this.evaluateNodeToJavaScript(e.value) +
                ', ' +
                JSON.stringify(e.qualifier) +
                ',' +
                JSON.stringify(e.op) +
                ')'
              );
            case 'case_expression': {
              let t = '';
              if ('simple' === e.format) {
                const r = 'this.makeComparable(' + this.evaluateNodeToJavaScript(e.operand) + ')';
                t = '( ';
                for (let n = 0; n < e.clauses.length; n++)
                  t +=
                    ' (' +
                    r +
                    ' === this.makeComparable(' +
                    this.evaluateNodeToJavaScript(e.clauses[n].operand) +
                    ')) ? (' +
                    this.evaluateNodeToJavaScript(e.clauses[n].value) +
                    ') : ';
                null !== e.else ? (t += this.evaluateNodeToJavaScript(e.else)) : (t += 'null'),
                  (t += ' )');
              } else {
                t = '( ';
                for (let r = 0; r < e.clauses.length; r++)
                  t +=
                    ' this.makeBool(' +
                    this.evaluateNodeToJavaScript(e.clauses[r].operand) +
                    ')===true ? (' +
                    this.evaluateNodeToJavaScript(e.clauses[r].value) +
                    ') : ';
                null !== e.else ? (t += this.evaluateNodeToJavaScript(e.else)) : (t += 'null'),
                  (t += ' )');
              }
              return t;
            }
            case 'param':
              return 'this.lookup(' + JSON.stringify(e.value.toLowerCase()) + ',lookups)';
            case 'expr_list': {
              let t = '[';
              for (const r of e.value)
                '[' !== t && (t += ','), (t += this.evaluateNodeToJavaScript(r));
              return (t += ']'), t;
            }
            case 'unary_expr':
              return 'this.ternaryNot(' + this.evaluateNodeToJavaScript(e.expr) + ')';
            case 'binary_expr':
              switch (e.operator) {
                case 'AND':
                  return (
                    'this.ternaryAnd(' +
                    this.evaluateNodeToJavaScript(e.left) +
                    ',' +
                    this.evaluateNodeToJavaScript(e.right) +
                    ' )'
                  );
                case 'OR':
                  return (
                    'this.ternaryOr(' +
                    this.evaluateNodeToJavaScript(e.left) +
                    ',' +
                    this.evaluateNodeToJavaScript(e.right) +
                    ' )'
                  );
                case 'IS':
                  if ('null' !== e.right.type) throw new Error('Unsupported RHS for IS');
                  return 'this.equalsNull(' + this.evaluateNodeToJavaScript(e.left) + ')';
                case 'ISNOT':
                  if ('null' !== e.right.type) throw new Error('Unsupported RHS for IS');
                  return '(!(this.equalsNull(' + this.evaluateNodeToJavaScript(e.left) + ')))';
                case 'IN':
                  return (
                    'this.applyIn(' +
                    this.evaluateNodeToJavaScript(e.left) +
                    ',this.ensureArray(' +
                    this.evaluateNodeToJavaScript(e.right) +
                    '))'
                  );
                case 'NOT IN':
                  return (
                    'this.ternaryNot(this.applyIn(' +
                    this.evaluateNodeToJavaScript(e.left) +
                    ',this.ensureArray(' +
                    this.evaluateNodeToJavaScript(e.right) +
                    ')))'
                  );
                case 'BETWEEN':
                  return (
                    'this.between(' +
                    this.evaluateNodeToJavaScript(e.left) +
                    ',' +
                    this.evaluateNodeToJavaScript(e.right) +
                    ')'
                  );
                case 'NOTBETWEEN':
                  return (
                    'this.notbetween(' +
                    this.evaluateNodeToJavaScript(e.left) +
                    ',' +
                    this.evaluateNodeToJavaScript(e.right) +
                    ')'
                  );
                case 'LIKE':
                  return (
                    'this.applyLike(' +
                    this.evaluateNodeToJavaScript(e.left) +
                    ',' +
                    this.evaluateNodeToJavaScript(e.right) +
                    ',' +
                    JSON.stringify(e.escape) +
                    ')'
                  );
                case 'NOT LIKE':
                  return (
                    'this.ternaryNot(this.applyLike(' +
                    this.evaluateNodeToJavaScript(e.left) +
                    ',' +
                    this.evaluateNodeToJavaScript(e.right) +
                    ',' +
                    JSON.stringify(e.escape) +
                    '))'
                  );
                case '<>':
                case '<':
                case '>':
                case '>=':
                case '<=':
                case '=':
                  return (
                    'this.compare(' +
                    JSON.stringify(e.operator) +
                    ',' +
                    this.evaluateNodeToJavaScript(e.left) +
                    ',' +
                    this.evaluateNodeToJavaScript(e.right) +
                    ')'
                  );
                case '*':
                case '-':
                case '+':
                case '/':
                  return (
                    'this.calculate(' +
                    JSON.stringify(e.operator) +
                    ',' +
                    this.evaluateNodeToJavaScript(e.left) +
                    ',' +
                    this.evaluateNodeToJavaScript(e.right) +
                    ')'
                  );
              }
              throw new Error('Not Supported Operator ' + e.operator);
            case 'null':
            case 'bool':
            case 'string':
            case 'number':
              return JSON.stringify(e.value);
            case 'date':
              return '(new Date(' + x(e.value).getTime().toString() + '))';
            case 'timestamp':
              return '(new Date(' + T(e.value).getTime().toString() + '))';
            case 'current_time':
              return 'date' === e.mode ? 'this.currentDate()' : 'this.currentTimestamp()';
            case 'column_ref':
              return (
                'this.featureValue(feature,' +
                JSON.stringify(e.column) +
                ',datefields,attributeAdapter)'
              );
            case 'function':
              return (
                'this.evaluateFunction(' +
                JSON.stringify(e.name) +
                ',' +
                this.evaluateNodeToJavaScript(e.args) +
                ')'
              );
          }
          throw new Error('Unsupported sql syntax ' + e.type);
        }
        evaluateNode(e, t, r) {
          switch (e.type) {
            case 'interval': {
              const n = this.evaluateNode(e.value, t, r);
              return o.createFromValueAndQualifer(n, e.qualifier, e.op);
            }
            case 'case_expression':
              if ('simple' === e.format) {
                const n = M(this.evaluateNode(e.operand, t, r));
                for (let a = 0; a < e.clauses.length; a++)
                  if (n === M(this.evaluateNode(e.clauses[a].operand, t, r)))
                    return this.evaluateNode(e.clauses[a].value, t, r);
                if (null !== e.else) return this.evaluateNode(e.else, t, r);
              } else {
                for (let n = 0; n < e.clauses.length; n++)
                  if (I(this.evaluateNode(e.clauses[n].operand, t, r)))
                    return this.evaluateNode(e.clauses[n].value, t, r);
                if (null !== e.else) return this.evaluateNode(e.else, t, r);
              }
              return null;
            case 'param':
              return this.parameters[e.value.toLowerCase()];
            case 'expr_list': {
              const n = [];
              for (const a of e.value) n.push(this.evaluateNode(a, t, r));
              return n;
            }
            case 'unary_expr':
              return E(this.evaluateNode(e.expr, t, r));
            case 'binary_expr':
              switch (e.operator) {
                case 'AND':
                  return S(this.evaluateNode(e.left, t, r), this.evaluateNode(e.right, t, r));
                case 'OR':
                  return C(this.evaluateNode(e.left, t, r), this.evaluateNode(e.right, t, r));
                case 'IS':
                  if ('null' !== e.right.type) throw new Error('Unsupported RHS for IS');
                  return null === this.evaluateNode(e.left, t, r);
                case 'ISNOT':
                  if ('null' !== e.right.type) throw new Error('Unsupported RHS for IS');
                  return null !== this.evaluateNode(e.left, t, r);
                case 'IN': {
                  const n = A(this.evaluateNode(e.right, t, r));
                  return P(this.evaluateNode(e.left, t, r), n);
                }
                case 'NOT IN': {
                  const n = A(this.evaluateNode(e.right, t, r));
                  return E(P(this.evaluateNode(e.left, t, r), n));
                }
                case 'BETWEEN': {
                  const n = this.evaluateNode(e.left, t, r),
                    a = this.evaluateNode(e.right, t, r);
                  return null == n || null == a[0] || null == a[1]
                    ? null
                    : n >= M(a[0]) && n <= M(a[1]);
                }
                case 'NOTBETWEEN': {
                  const n = this.evaluateNode(e.left, t, r),
                    a = this.evaluateNode(e.right, t, r);
                  return null == n || null == a[0] || null == a[1]
                    ? null
                    : n < M(a[0]) || n > M(a[1]);
                }
                case 'LIKE':
                  return L(
                    this.evaluateNode(e.left, t, r),
                    this.evaluateNode(e.right, t, r),
                    e.escape,
                  );
                case 'NOT LIKE':
                  return E(
                    L(this.evaluateNode(e.left, t, r), this.evaluateNode(e.right, t, r), e.escape),
                  );
                case '<>':
                case '<':
                case '>':
                case '>=':
                case '<=':
                case '=':
                  return F(
                    e.operator,
                    this.evaluateNode(e.left, t, r),
                    this.evaluateNode(e.right, t, r),
                  );
                case '-':
                case '+':
                case '*':
                case '/':
                  return _(
                    e.operator,
                    this.evaluateNode(e.left, t, r),
                    this.evaluateNode(e.right, t, r),
                  );
              }
            case 'null':
            case 'bool':
            case 'string':
            case 'number':
              return e.value;
            case 'date':
              return x(e.value);
            case 'timestamp':
              return T(e.value);
            case 'current_time': {
              const t = new Date();
              return 'date' === e.mode && t.setHours(0, 0, 0, 0), t;
            }
            case 'column_ref':
              return R(t, e.column, this.datefields, r);
            case 'function': {
              const n = this.evaluateNode(e.args, t, r);
              return this.isAggregate
                ? (function (e, t) {
                    const r = s[e.toLowerCase()];
                    if (null == r) throw new Error('Function Not Recognised');
                    if (t.length < r.minParams || t.length > r.maxParams)
                      throw new Error(`Invalid Parameter count for call to ${e.toUpperCase()}`);
                    return r.evaluate(t);
                  })(e.name, n)
                : l(e.name, n);
            }
          }
          throw new Error('Unsupported sql syntax ' + e.type);
        }
      }
      function T(e) {
        let t = h.exec(e);
        if (null !== t) {
          const [, e, r, n, a, s, u] = t;
          return y(e, r, n, a, s, u);
        }
        if (((t = d.exec(e)), null !== t)) {
          const [, e, r, n, a, s, u, i, o, l] = t;
          return y(e, r, n, a, s, u, i, o, l);
        }
        if (((t = m.exec(e)), null !== t)) {
          const [, e, r, n, a, s, u, i, o] = t;
          return y(e, r, n, a, s, '0', u, i, o);
        }
        if (((t = g.exec(e)), null !== t)) {
          const [, e, r, n, a, s] = t;
          return y(e, r, n, a, s);
        }
        if (((t = v.exec(e)), null !== t)) {
          const [, e, r, n] = t;
          return y(e, r, n);
        }
        throw new Error('SQL Invalid Timestamp');
      }
      function x(e) {
        const t = v.exec(e);
        if (null === t) throw new Error('SQL Invalid Date');
        const [, r, n, a] = t;
        return new Date(parseInt(r, 10), parseInt(n, 10) - 1, parseInt(a, 10));
      }
      function I(e) {
        return !0 === e;
      }
      function A(e) {
        return Array.isArray(e) ? e : [e];
      }
      function E(e) {
        return null !== e ? !0 !== e : null;
      }
      function S(e, t) {
        return null != e && null != t ? !0 === e && !0 === t : !1 !== e && !1 !== t && null;
      }
      function C(e, t) {
        return null != e && null != t ? !0 === e || !0 === t : !0 === e || !0 === t || null;
      }
      function P(e, t) {
        if (null == e) return null;
        let r = !1;
        for (const n of t)
          if (null == n) r = null;
          else if (e === n) {
            r = !0;
            break;
          }
        return r;
      }
      function L(e, t, r) {
        if (null == e) return null;
        const n = t,
          a = r;
        let s = '';
        const u = '-[]/{}()*+?.\\^$|';
        let i = 0;
        for (let e = 0; e < n.length; e++) {
          const t = n.charAt(e);
          switch (i) {
            case 0:
              t === a
                ? (i = 1)
                : u.indexOf(t) >= 0
                ? (s += '\\' + t)
                : (s += '%' === t ? '.*' : '_' === t ? '.' : t);
              break;
            case 1:
              u.indexOf(t) >= 0 ? (s += '\\' + t) : (s += t), (i = 0);
          }
        }
        return new RegExp('^' + s + '$').test(e);
      }
      function M(e) {
        return e instanceof Date ? e.valueOf() : e;
      }
      function F(e, t, r) {
        if (null == t || null == r) return null;
        const n = M(t),
          a = M(r);
        switch (e) {
          case '<>':
            return n !== a;
          case '=':
            return n === a;
          case '>':
            return n > a;
          case '<':
            return n < a;
          case '>=':
            return n >= a;
          case '<=':
            return n <= a;
        }
      }
      function O(e) {
        const t = [],
          r = {};
        for (const n of e) {
          const e = n.toLowerCase();
          void 0 === r[e] && (t.push(n), (r[e] = 1));
        }
        return t;
      }
      function _(e, t, r) {
        if (t instanceof o)
          if (r instanceof Date)
            switch (e) {
              case '+':
                return new Date(t.valueInMilliseconds() + r.getTime());
              case '-':
                return t.valueInMilliseconds() - r.getTime();
              case '*':
                return t.valueInMilliseconds() * r.getTime();
              case '/':
                return t.valueInMilliseconds() / r.getTime();
            }
          else if (r instanceof o)
            switch (e) {
              case '+':
                return o.createFromMilliseconds(t.valueInMilliseconds() + r.valueInMilliseconds());
              case '-':
                return o.createFromMilliseconds(t.valueInMilliseconds() - r.valueInMilliseconds());
              case '*':
                return t.valueInMilliseconds() * r.valueInMilliseconds();
              case '/':
                return t.valueInMilliseconds() / r.valueInMilliseconds();
            }
          else t = t.valueInMilliseconds();
        else if (r instanceof o)
          if (t instanceof Date)
            switch (e) {
              case '+':
                return new Date(r.valueInMilliseconds() + t.getTime());
              case '-':
                return new Date(t.getTime() - r.valueInMilliseconds());
              case '*':
                return t.getTime() * r.valueInMilliseconds();
              case '/':
                return t.getTime() / r.valueInMilliseconds();
            }
          else r = r.valueInMilliseconds();
        else if (t instanceof Date && 'number' == typeof r)
          switch (((r = 24 * r * 60 * 60 * 1e3), (t = t.getTime()), e)) {
            case '+':
              return new Date(t + r);
            case '-':
              return new Date(t - r);
            case '*':
              return new Date(t * r);
            case '/':
              return new Date(t / r);
          }
        else if (r instanceof Date && 'number' == typeof t)
          switch (((t = 24 * t * 60 * 60 * 1e3), (r = r.getTime()), e)) {
            case '+':
              return new Date(t + r);
            case '-':
              return new Date(t - r);
            case '*':
              return new Date(t * r);
            case '/':
              return new Date(t / r);
          }
        switch (e) {
          case '+':
            return t + r;
          case '-':
            return t - r;
          case '*':
            return t * r;
          case '/':
            return t / r;
        }
      }
      function R(e, t, r, n) {
        const a = n.getAttribute(e, t);
        return null != a && 1 === r[t] ? new Date(a) : a;
      }
      const D = {
        getAttribute(e, t) {
          var r;
          return ((r = e) && 'object' == typeof r.attributes ? e.attributes : e)[t];
        },
      };
    },
  },
]);
