class s {
  constructor() {
    var e = {};
    e._next = e._prev = e, this._sentinel = e;
  }
  dequeue() {
    var e = this._sentinel, n = e._prev;
    if (n !== e)
      return i(n), n;
  }
  enqueue(e) {
    var n = this._sentinel;
    e._prev && e._next && i(e), e._next = n._next, n._next._prev = e, n._next = e, e._prev = n;
  }
  toString() {
    for (var e = [], n = this._sentinel, _ = n._prev; _ !== n; )
      e.push(JSON.stringify(_, r)), _ = _._prev;
    return "[" + e.join(", ") + "]";
  }
}
function i(t) {
  t._prev._next = t._next, t._next._prev = t._prev, delete t._next, delete t._prev;
}
function r(t, e) {
  if (t !== "_next" && t !== "_prev")
    return e;
}
export {
  s as List
};
