import { p as z } from "../../../../../../_virtual/parser2.js";
import "./selectors/root.js";
import "./selectors/selector.js";
import "./selectors/className.js";
import "./selectors/comment.js";
import "./selectors/id.js";
import "./selectors/tag.js";
import "./selectors/string.js";
import "./selectors/pseudo.js";
import "./selectors/attribute.js";
import "./selectors/universal.js";
import "./selectors/combinator.js";
import "./selectors/nesting.js";
import "./sortAscending.js";
import "./tokenize.js";
import "./tokenTypes.js";
import "./selectors/types.js";
import "./util/index.js";
import { __exports as Te } from "../../../../../../_virtual/attribute.js";
import { __exports as Se } from "../../../../../../_virtual/tokenize.js";
import { __exports as de } from "../../../../../../_virtual/tokenTypes.js";
import { __exports as Ee } from "../../../../../../_virtual/types.js";
import { __exports as me } from "../../../../../../_virtual/index41.js";
import { r as ke } from "../../../../../../_virtual/root.js";
import { s as Ie } from "../../../../../../_virtual/selector.js";
import { c as Le } from "../../../../../../_virtual/className.js";
import { c as De } from "../../../../../../_virtual/comment.js";
import { i as Pe } from "../../../../../../_virtual/id.js";
import { t as be } from "../../../../../../_virtual/tag.js";
import { s as we } from "../../../../../../_virtual/string2.js";
import { p as Fe } from "../../../../../../_virtual/pseudo.js";
import { u as _e } from "../../../../../../_virtual/universal.js";
import { c as ge } from "../../../../../../_virtual/combinator.js";
import { n as xe } from "../../../../../../_virtual/nesting.js";
import { s as Oe } from "../../../../../../_virtual/sortAscending.js";
(function(Q, O) {
  O.__esModule = !0, O.default = void 0;
  var J = k(ke.exports), R = k(Ie.exports), X = k(Le.exports), j = k(De.exports), Z = k(Pe.exports), V = k(be.exports), Y = k(we.exports), ee = k(Fe.exports), G = N(Te), te = k(_e.exports), q = k(ge.exports), re = k(xe.exports), se = k(Oe.exports), r = N(Se), i = N(de), ie = N(Ee), T = me, w, C;
  function U() {
    if (typeof WeakMap != "function")
      return null;
    var a = /* @__PURE__ */ new WeakMap();
    return U = function() {
      return a;
    }, a;
  }
  function N(a) {
    if (a && a.__esModule)
      return a;
    if (a === null || typeof a != "object" && typeof a != "function")
      return { default: a };
    var o = U();
    if (o && o.has(a))
      return o.get(a);
    var n = {}, e = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for (var s in a)
      if (Object.prototype.hasOwnProperty.call(a, s)) {
        var u = e ? Object.getOwnPropertyDescriptor(a, s) : null;
        u && (u.get || u.set) ? Object.defineProperty(n, s, u) : n[s] = a[s];
      }
    return n.default = a, o && o.set(a, n), n;
  }
  function k(a) {
    return a && a.__esModule ? a : { default: a };
  }
  function K(a, o) {
    for (var n = 0; n < o.length; n++) {
      var e = o[n];
      e.enumerable = e.enumerable || !1, e.configurable = !0, "value" in e && (e.writable = !0), Object.defineProperty(a, e.key, e);
    }
  }
  function ne(a, o, n) {
    return o && K(a.prototype, o), n && K(a, n), a;
  }
  var W = (w = {}, w[i.space] = !0, w[i.cr] = !0, w[i.feed] = !0, w[i.newline] = !0, w[i.tab] = !0, w), ae = Object.assign({}, W, (C = {}, C[i.comment] = !0, C));
  function H(a) {
    return {
      line: a[r.FIELDS.START_LINE],
      column: a[r.FIELDS.START_COL]
    };
  }
  function $(a) {
    return {
      line: a[r.FIELDS.END_LINE],
      column: a[r.FIELDS.END_COL]
    };
  }
  function F(a, o, n, e) {
    return {
      start: {
        line: a,
        column: o
      },
      end: {
        line: n,
        column: e
      }
    };
  }
  function _(a) {
    return F(a[r.FIELDS.START_LINE], a[r.FIELDS.START_COL], a[r.FIELDS.END_LINE], a[r.FIELDS.END_COL]);
  }
  function M(a, o) {
    if (!!a)
      return F(a[r.FIELDS.START_LINE], a[r.FIELDS.START_COL], o[r.FIELDS.END_LINE], o[r.FIELDS.END_COL]);
  }
  function g(a, o) {
    var n = a[o];
    if (typeof n == "string")
      return n.indexOf("\\") !== -1 && ((0, T.ensureObject)(a, "raws"), a[o] = (0, T.unesc)(n), a.raws[o] === void 0 && (a.raws[o] = n)), a;
  }
  function B(a, o) {
    for (var n = -1, e = []; (n = a.indexOf(o, n + 1)) !== -1; )
      e.push(n);
    return e;
  }
  function oe() {
    var a = Array.prototype.concat.apply([], arguments);
    return a.filter(function(o, n) {
      return n === a.indexOf(o);
    });
  }
  var ue = /* @__PURE__ */ function() {
    function a(n, e) {
      e === void 0 && (e = {}), this.rule = n, this.options = Object.assign({
        lossy: !1,
        safe: !1
      }, e), this.position = 0, this.css = typeof this.rule == "string" ? this.rule : this.rule.selector, this.tokens = (0, r.default)({
        css: this.css,
        error: this._errorGenerator(),
        safe: this.options.safe
      });
      var s = M(this.tokens[0], this.tokens[this.tokens.length - 1]);
      this.root = new J.default({
        source: s
      }), this.root.errorGenerator = this._errorGenerator();
      var u = new R.default({
        source: {
          start: {
            line: 1,
            column: 1
          }
        }
      });
      this.root.append(u), this.current = u, this.loop();
    }
    var o = a.prototype;
    return o._errorGenerator = function() {
      var e = this;
      return function(s, u) {
        return typeof e.rule == "string" ? new Error(s) : e.rule.error(s, u);
      };
    }, o.attribute = function() {
      var e = [], s = this.currToken;
      for (this.position++; this.position < this.tokens.length && this.currToken[r.FIELDS.TYPE] !== i.closeSquare; )
        e.push(this.currToken), this.position++;
      if (this.currToken[r.FIELDS.TYPE] !== i.closeSquare)
        return this.expected("closing square bracket", this.currToken[r.FIELDS.START_POS]);
      var u = e.length, t = {
        source: F(s[1], s[2], this.currToken[3], this.currToken[4]),
        sourceIndex: s[r.FIELDS.START_POS]
      };
      if (u === 1 && !~[i.word].indexOf(e[0][r.FIELDS.TYPE]))
        return this.expected("attribute", e[0][r.FIELDS.START_POS]);
      for (var p = 0, l = "", f = "", c = null, v = !1; p < u; ) {
        var d = e[p], h = this.content(d), S = e[p + 1];
        switch (d[r.FIELDS.TYPE]) {
          case i.space:
            if (v = !0, this.options.lossy)
              break;
            if (c) {
              (0, T.ensureObject)(t, "spaces", c);
              var P = t.spaces[c].after || "";
              t.spaces[c].after = P + h;
              var D = (0, T.getProp)(t, "raws", "spaces", c, "after") || null;
              D && (t.raws.spaces[c].after = D + h);
            } else
              l = l + h, f = f + h;
            break;
          case i.asterisk:
            if (S[r.FIELDS.TYPE] === i.equals)
              t.operator = h, c = "operator";
            else if ((!t.namespace || c === "namespace" && !v) && S) {
              l && ((0, T.ensureObject)(t, "spaces", "attribute"), t.spaces.attribute.before = l, l = ""), f && ((0, T.ensureObject)(t, "raws", "spaces", "attribute"), t.raws.spaces.attribute.before = l, f = ""), t.namespace = (t.namespace || "") + h;
              var m = (0, T.getProp)(t, "raws", "namespace") || null;
              m && (t.raws.namespace += h), c = "namespace";
            }
            v = !1;
            break;
          case i.dollar:
            if (c === "value") {
              var E = (0, T.getProp)(t, "raws", "value");
              t.value += "$", E && (t.raws.value = E + "$");
              break;
            }
          case i.caret:
            S[r.FIELDS.TYPE] === i.equals && (t.operator = h, c = "operator"), v = !1;
            break;
          case i.combinator:
            if (h === "~" && S[r.FIELDS.TYPE] === i.equals && (t.operator = h, c = "operator"), h !== "|") {
              v = !1;
              break;
            }
            S[r.FIELDS.TYPE] === i.equals ? (t.operator = h, c = "operator") : !t.namespace && !t.attribute && (t.namespace = !0), v = !1;
            break;
          case i.word:
            if (S && this.content(S) === "|" && e[p + 2] && e[p + 2][r.FIELDS.TYPE] !== i.equals && !t.operator && !t.namespace)
              t.namespace = h, c = "namespace";
            else if (!t.attribute || c === "attribute" && !v) {
              l && ((0, T.ensureObject)(t, "spaces", "attribute"), t.spaces.attribute.before = l, l = ""), f && ((0, T.ensureObject)(t, "raws", "spaces", "attribute"), t.raws.spaces.attribute.before = f, f = ""), t.attribute = (t.attribute || "") + h;
              var I = (0, T.getProp)(t, "raws", "attribute") || null;
              I && (t.raws.attribute += h), c = "attribute";
            } else if (!t.value && t.value !== "" || c === "value" && !v) {
              var L = (0, T.unesc)(h), b = (0, T.getProp)(t, "raws", "value") || "", A = t.value || "";
              t.value = A + L, t.quoteMark = null, (L !== h || b) && ((0, T.ensureObject)(t, "raws"), t.raws.value = (b || A) + h), c = "value";
            } else {
              var y = h === "i" || h === "I";
              (t.value || t.value === "") && (t.quoteMark || v) ? (t.insensitive = y, (!y || h === "I") && ((0, T.ensureObject)(t, "raws"), t.raws.insensitiveFlag = h), c = "insensitive", l && ((0, T.ensureObject)(t, "spaces", "insensitive"), t.spaces.insensitive.before = l, l = ""), f && ((0, T.ensureObject)(t, "raws", "spaces", "insensitive"), t.raws.spaces.insensitive.before = f, f = "")) : (t.value || t.value === "") && (c = "value", t.value += h, t.raws.value && (t.raws.value += h));
            }
            v = !1;
            break;
          case i.str:
            if (!t.attribute || !t.operator)
              return this.error("Expected an attribute followed by an operator preceding the string.", {
                index: d[r.FIELDS.START_POS]
              });
            var x = (0, G.unescapeValue)(h), ce = x.unescaped, he = x.quoteMark;
            t.value = ce, t.quoteMark = he, c = "value", (0, T.ensureObject)(t, "raws"), t.raws.value = h, v = !1;
            break;
          case i.equals:
            if (!t.attribute)
              return this.expected("attribute", d[r.FIELDS.START_POS], h);
            if (t.value)
              return this.error('Unexpected "=" found; an operator was already defined.', {
                index: d[r.FIELDS.START_POS]
              });
            t.operator = t.operator ? t.operator + h : h, c = "operator", v = !1;
            break;
          case i.comment:
            if (c)
              if (v || S && S[r.FIELDS.TYPE] === i.space || c === "insensitive") {
                var pe = (0, T.getProp)(t, "spaces", c, "after") || "", fe = (0, T.getProp)(t, "raws", "spaces", c, "after") || pe;
                (0, T.ensureObject)(t, "raws", "spaces", c), t.raws.spaces[c].after = fe + h;
              } else {
                var le = t[c] || "", ve = (0, T.getProp)(t, "raws", c) || le;
                (0, T.ensureObject)(t, "raws"), t.raws[c] = ve + h;
              }
            else
              f = f + h;
            break;
          default:
            return this.error('Unexpected "' + h + '" found.', {
              index: d[r.FIELDS.START_POS]
            });
        }
        p++;
      }
      g(t, "attribute"), g(t, "namespace"), this.newNode(new G.default(t)), this.position++;
    }, o.parseWhitespaceEquivalentTokens = function(e) {
      e < 0 && (e = this.tokens.length);
      var s = this.position, u = [], t = "", p = void 0;
      do
        if (W[this.currToken[r.FIELDS.TYPE]])
          this.options.lossy || (t += this.content());
        else if (this.currToken[r.FIELDS.TYPE] === i.comment) {
          var l = {};
          t && (l.before = t, t = ""), p = new j.default({
            value: this.content(),
            source: _(this.currToken),
            sourceIndex: this.currToken[r.FIELDS.START_POS],
            spaces: l
          }), u.push(p);
        }
      while (++this.position < e);
      if (t) {
        if (p)
          p.spaces.after = t;
        else if (!this.options.lossy) {
          var f = this.tokens[s], c = this.tokens[this.position - 1];
          u.push(new Y.default({
            value: "",
            source: F(f[r.FIELDS.START_LINE], f[r.FIELDS.START_COL], c[r.FIELDS.END_LINE], c[r.FIELDS.END_COL]),
            sourceIndex: f[r.FIELDS.START_POS],
            spaces: {
              before: t,
              after: ""
            }
          }));
        }
      }
      return u;
    }, o.convertWhitespaceNodesToSpace = function(e, s) {
      var u = this;
      s === void 0 && (s = !1);
      var t = "", p = "";
      e.forEach(function(f) {
        var c = u.lossySpace(f.spaces.before, s), v = u.lossySpace(f.rawSpaceBefore, s);
        t += c + u.lossySpace(f.spaces.after, s && c.length === 0), p += c + f.value + u.lossySpace(f.rawSpaceAfter, s && v.length === 0);
      }), p === t && (p = void 0);
      var l = {
        space: t,
        rawSpace: p
      };
      return l;
    }, o.isNamedCombinator = function(e) {
      return e === void 0 && (e = this.position), this.tokens[e + 0] && this.tokens[e + 0][r.FIELDS.TYPE] === i.slash && this.tokens[e + 1] && this.tokens[e + 1][r.FIELDS.TYPE] === i.word && this.tokens[e + 2] && this.tokens[e + 2][r.FIELDS.TYPE] === i.slash;
    }, o.namedCombinator = function() {
      if (this.isNamedCombinator()) {
        var e = this.content(this.tokens[this.position + 1]), s = (0, T.unesc)(e).toLowerCase(), u = {};
        s !== e && (u.value = "/" + e + "/");
        var t = new q.default({
          value: "/" + s + "/",
          source: F(this.currToken[r.FIELDS.START_LINE], this.currToken[r.FIELDS.START_COL], this.tokens[this.position + 2][r.FIELDS.END_LINE], this.tokens[this.position + 2][r.FIELDS.END_COL]),
          sourceIndex: this.currToken[r.FIELDS.START_POS],
          raws: u
        });
        return this.position = this.position + 3, t;
      } else
        this.unexpected();
    }, o.combinator = function() {
      var e = this;
      if (this.content() === "|")
        return this.namespace();
      var s = this.locateNextMeaningfulToken(this.position);
      if (s < 0 || this.tokens[s][r.FIELDS.TYPE] === i.comma) {
        var u = this.parseWhitespaceEquivalentTokens(s);
        if (u.length > 0) {
          var t = this.current.last;
          if (t) {
            var p = this.convertWhitespaceNodesToSpace(u), l = p.space, f = p.rawSpace;
            f !== void 0 && (t.rawSpaceAfter += f), t.spaces.after += l;
          } else
            u.forEach(function(b) {
              return e.newNode(b);
            });
        }
        return;
      }
      var c = this.currToken, v = void 0;
      s > this.position && (v = this.parseWhitespaceEquivalentTokens(s));
      var d;
      if (this.isNamedCombinator() ? d = this.namedCombinator() : this.currToken[r.FIELDS.TYPE] === i.combinator ? (d = new q.default({
        value: this.content(),
        source: _(this.currToken),
        sourceIndex: this.currToken[r.FIELDS.START_POS]
      }), this.position++) : W[this.currToken[r.FIELDS.TYPE]] || v || this.unexpected(), d) {
        if (v) {
          var h = this.convertWhitespaceNodesToSpace(v), S = h.space, P = h.rawSpace;
          d.spaces.before = S, d.rawSpaceBefore = P;
        }
      } else {
        var D = this.convertWhitespaceNodesToSpace(v, !0), m = D.space, E = D.rawSpace;
        E || (E = m);
        var I = {}, L = {
          spaces: {}
        };
        m.endsWith(" ") && E.endsWith(" ") ? (I.before = m.slice(0, m.length - 1), L.spaces.before = E.slice(0, E.length - 1)) : m.startsWith(" ") && E.startsWith(" ") ? (I.after = m.slice(1), L.spaces.after = E.slice(1)) : L.value = E, d = new q.default({
          value: " ",
          source: M(c, this.tokens[this.position - 1]),
          sourceIndex: c[r.FIELDS.START_POS],
          spaces: I,
          raws: L
        });
      }
      return this.currToken && this.currToken[r.FIELDS.TYPE] === i.space && (d.spaces.after = this.optionalSpace(this.content()), this.position++), this.newNode(d);
    }, o.comma = function() {
      if (this.position === this.tokens.length - 1) {
        this.root.trailingComma = !0, this.position++;
        return;
      }
      this.current._inferEndPosition();
      var e = new R.default({
        source: {
          start: H(this.tokens[this.position + 1])
        }
      });
      this.current.parent.append(e), this.current = e, this.position++;
    }, o.comment = function() {
      var e = this.currToken;
      this.newNode(new j.default({
        value: this.content(),
        source: _(e),
        sourceIndex: e[r.FIELDS.START_POS]
      })), this.position++;
    }, o.error = function(e, s) {
      throw this.root.error(e, s);
    }, o.missingBackslash = function() {
      return this.error("Expected a backslash preceding the semicolon.", {
        index: this.currToken[r.FIELDS.START_POS]
      });
    }, o.missingParenthesis = function() {
      return this.expected("opening parenthesis", this.currToken[r.FIELDS.START_POS]);
    }, o.missingSquareBracket = function() {
      return this.expected("opening square bracket", this.currToken[r.FIELDS.START_POS]);
    }, o.unexpected = function() {
      return this.error("Unexpected '" + this.content() + "'. Escaping special characters with \\ may help.", this.currToken[r.FIELDS.START_POS]);
    }, o.namespace = function() {
      var e = this.prevToken && this.content(this.prevToken) || !0;
      if (this.nextToken[r.FIELDS.TYPE] === i.word)
        return this.position++, this.word(e);
      if (this.nextToken[r.FIELDS.TYPE] === i.asterisk)
        return this.position++, this.universal(e);
    }, o.nesting = function() {
      if (this.nextToken) {
        var e = this.content(this.nextToken);
        if (e === "|") {
          this.position++;
          return;
        }
      }
      var s = this.currToken;
      this.newNode(new re.default({
        value: this.content(),
        source: _(s),
        sourceIndex: s[r.FIELDS.START_POS]
      })), this.position++;
    }, o.parentheses = function() {
      var e = this.current.last, s = 1;
      if (this.position++, e && e.type === ie.PSEUDO) {
        var u = new R.default({
          source: {
            start: H(this.tokens[this.position - 1])
          }
        }), t = this.current;
        for (e.append(u), this.current = u; this.position < this.tokens.length && s; )
          this.currToken[r.FIELDS.TYPE] === i.openParenthesis && s++, this.currToken[r.FIELDS.TYPE] === i.closeParenthesis && s--, s ? this.parse() : (this.current.source.end = $(this.currToken), this.current.parent.source.end = $(this.currToken), this.position++);
        this.current = t;
      } else {
        for (var p = this.currToken, l = "(", f; this.position < this.tokens.length && s; )
          this.currToken[r.FIELDS.TYPE] === i.openParenthesis && s++, this.currToken[r.FIELDS.TYPE] === i.closeParenthesis && s--, f = this.currToken, l += this.parseParenthesisToken(this.currToken), this.position++;
        e ? e.appendToPropertyAndEscape("value", l, l) : this.newNode(new Y.default({
          value: l,
          source: F(p[r.FIELDS.START_LINE], p[r.FIELDS.START_COL], f[r.FIELDS.END_LINE], f[r.FIELDS.END_COL]),
          sourceIndex: p[r.FIELDS.START_POS]
        }));
      }
      if (s)
        return this.expected("closing parenthesis", this.currToken[r.FIELDS.START_POS]);
    }, o.pseudo = function() {
      for (var e = this, s = "", u = this.currToken; this.currToken && this.currToken[r.FIELDS.TYPE] === i.colon; )
        s += this.content(), this.position++;
      if (!this.currToken)
        return this.expected(["pseudo-class", "pseudo-element"], this.position - 1);
      if (this.currToken[r.FIELDS.TYPE] === i.word)
        this.splitWord(!1, function(t, p) {
          s += t, e.newNode(new ee.default({
            value: s,
            source: M(u, e.currToken),
            sourceIndex: u[r.FIELDS.START_POS]
          })), p > 1 && e.nextToken && e.nextToken[r.FIELDS.TYPE] === i.openParenthesis && e.error("Misplaced parenthesis.", {
            index: e.nextToken[r.FIELDS.START_POS]
          });
        });
      else
        return this.expected(["pseudo-class", "pseudo-element"], this.currToken[r.FIELDS.START_POS]);
    }, o.space = function() {
      var e = this.content();
      this.position === 0 || this.prevToken[r.FIELDS.TYPE] === i.comma || this.prevToken[r.FIELDS.TYPE] === i.openParenthesis || this.current.nodes.every(function(s) {
        return s.type === "comment";
      }) ? (this.spaces = this.optionalSpace(e), this.position++) : this.position === this.tokens.length - 1 || this.nextToken[r.FIELDS.TYPE] === i.comma || this.nextToken[r.FIELDS.TYPE] === i.closeParenthesis ? (this.current.last.spaces.after = this.optionalSpace(e), this.position++) : this.combinator();
    }, o.string = function() {
      var e = this.currToken;
      this.newNode(new Y.default({
        value: this.content(),
        source: _(e),
        sourceIndex: e[r.FIELDS.START_POS]
      })), this.position++;
    }, o.universal = function(e) {
      var s = this.nextToken;
      if (s && this.content(s) === "|")
        return this.position++, this.namespace();
      var u = this.currToken;
      this.newNode(new te.default({
        value: this.content(),
        source: _(u),
        sourceIndex: u[r.FIELDS.START_POS]
      }), e), this.position++;
    }, o.splitWord = function(e, s) {
      for (var u = this, t = this.nextToken, p = this.content(); t && ~[i.dollar, i.caret, i.equals, i.word].indexOf(t[r.FIELDS.TYPE]); ) {
        this.position++;
        var l = this.content();
        if (p += l, l.lastIndexOf("\\") === l.length - 1) {
          var f = this.nextToken;
          f && f[r.FIELDS.TYPE] === i.space && (p += this.requiredSpace(this.content(f)), this.position++);
        }
        t = this.nextToken;
      }
      var c = B(p, ".").filter(function(S) {
        var P = p[S - 1] === "\\", D = /^\d+\.\d+%$/.test(p);
        return !P && !D;
      }), v = B(p, "#").filter(function(S) {
        return p[S - 1] !== "\\";
      }), d = B(p, "#{");
      d.length && (v = v.filter(function(S) {
        return !~d.indexOf(S);
      }));
      var h = (0, se.default)(oe([0].concat(c, v)));
      h.forEach(function(S, P) {
        var D = h[P + 1] || p.length, m = p.slice(S, D);
        if (P === 0 && s)
          return s.call(u, m, h.length);
        var E, I = u.currToken, L = I[r.FIELDS.START_POS] + h[P], b = F(I[1], I[2] + S, I[3], I[2] + (D - 1));
        if (~c.indexOf(S)) {
          var A = {
            value: m.slice(1),
            source: b,
            sourceIndex: L
          };
          E = new X.default(g(A, "value"));
        } else if (~v.indexOf(S)) {
          var y = {
            value: m.slice(1),
            source: b,
            sourceIndex: L
          };
          E = new Z.default(g(y, "value"));
        } else {
          var x = {
            value: m,
            source: b,
            sourceIndex: L
          };
          g(x, "value"), E = new V.default(x);
        }
        u.newNode(E, e), e = null;
      }), this.position++;
    }, o.word = function(e) {
      var s = this.nextToken;
      return s && this.content(s) === "|" ? (this.position++, this.namespace()) : this.splitWord(e);
    }, o.loop = function() {
      for (; this.position < this.tokens.length; )
        this.parse(!0);
      return this.current._inferEndPosition(), this.root;
    }, o.parse = function(e) {
      switch (this.currToken[r.FIELDS.TYPE]) {
        case i.space:
          this.space();
          break;
        case i.comment:
          this.comment();
          break;
        case i.openParenthesis:
          this.parentheses();
          break;
        case i.closeParenthesis:
          e && this.missingParenthesis();
          break;
        case i.openSquare:
          this.attribute();
          break;
        case i.dollar:
        case i.caret:
        case i.equals:
        case i.word:
          this.word();
          break;
        case i.colon:
          this.pseudo();
          break;
        case i.comma:
          this.comma();
          break;
        case i.asterisk:
          this.universal();
          break;
        case i.ampersand:
          this.nesting();
          break;
        case i.slash:
        case i.combinator:
          this.combinator();
          break;
        case i.str:
          this.string();
          break;
        case i.closeSquare:
          this.missingSquareBracket();
        case i.semicolon:
          this.missingBackslash();
        default:
          this.unexpected();
      }
    }, o.expected = function(e, s, u) {
      if (Array.isArray(e)) {
        var t = e.pop();
        e = e.join(", ") + " or " + t;
      }
      var p = /^[aeiou]/.test(e[0]) ? "an" : "a";
      return u ? this.error("Expected " + p + " " + e + ', found "' + u + '" instead.', {
        index: s
      }) : this.error("Expected " + p + " " + e + ".", {
        index: s
      });
    }, o.requiredSpace = function(e) {
      return this.options.lossy ? " " : e;
    }, o.optionalSpace = function(e) {
      return this.options.lossy ? "" : e;
    }, o.lossySpace = function(e, s) {
      return this.options.lossy ? s ? " " : "" : e;
    }, o.parseParenthesisToken = function(e) {
      var s = this.content(e);
      return e[r.FIELDS.TYPE] === i.space ? this.requiredSpace(s) : s;
    }, o.newNode = function(e, s) {
      return s && (/^ +$/.test(s) && (this.options.lossy || (this.spaces = (this.spaces || "") + s), s = !0), e.namespace = s, g(e, "namespace")), this.spaces && (e.spaces.before = this.spaces, this.spaces = ""), this.current.append(e);
    }, o.content = function(e) {
      return e === void 0 && (e = this.currToken), this.css.slice(e[r.FIELDS.START_POS], e[r.FIELDS.END_POS]);
    }, o.locateNextMeaningfulToken = function(e) {
      e === void 0 && (e = this.position + 1);
      for (var s = e; s < this.tokens.length; )
        if (ae[this.tokens[s][r.FIELDS.TYPE]]) {
          s++;
          continue;
        } else
          return s;
      return -1;
    }, ne(a, [{
      key: "currToken",
      get: function() {
        return this.tokens[this.position];
      }
    }, {
      key: "nextToken",
      get: function() {
        return this.tokens[this.position + 1];
      }
    }, {
      key: "prevToken",
      get: function() {
        return this.tokens[this.position - 1];
      }
    }]), a;
  }();
  O.default = ue, Q.exports = O.default;
})(z, z.exports);
//# sourceMappingURL=parser.js.map
