text: /* */ 
  "use strict";
  var __extends = (this && this.__extends) || function(d, b) {
    for (var p in b)
      if (b.hasOwnProperty(p))
        d[p] = b[p];
    function __() {
      this.constructor = d;
    }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
  var Subscriber_1 = require('../Subscriber');
  var tryCatch_1 = require('../util/tryCatch');
  var errorObject_1 = require('../util/errorObject');
  function sequenceEqual(compareTo, comparor) {
    return this.lift(new SequenceEqualOperator(compareTo, comparor));
  }
  exports.sequenceEqual = sequenceEqual;
  var SequenceEqualOperator = (function() {
    function SequenceEqualOperator(compareTo, comparor) {
      this.compareTo = compareTo;
      this.comparor = comparor;
    }
    SequenceEqualOperator.prototype.call = function(subscriber, source) {
      return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparor));
    };
    return SequenceEqualOperator;
  }());
  exports.SequenceEqualOperator = SequenceEqualOperator;
  var SequenceEqualSubscriber = (function(_super) {
    __extends(SequenceEqualSubscriber, _super);
    function SequenceEqualSubscriber(destination, compareTo, comparor) {
      _super.call(this, destination);
      this.compareTo = compareTo;
      this.comparor = comparor;
      this._a = [];
      this._b = [];
      this._oneComplete = false;
      this.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, this)));
    }
    SequenceEqualSubscriber.prototype._next = function(value) {
      if (this._oneComplete && this._b.length === 0) {
        this.emit(false);
      } else {
        this._a.push(value);
        this.checkValues();
      }
    };
    SequenceEqualSubscriber.prototype._complete = function() {
      if (this._oneComplete) {
        this.emit(this._a.length === 0 && this._b.length === 0);
      } else {
        this._oneComplete = true;
      }
    };
    SequenceEqualSubscriber.prototype.checkValues = function() {
      var _c = this,
          _a = _c._a,
          _b = _c._b,
          comparor = _c.comparor;
      while (_a.length > 0 && _b.length > 0) {
        var a = _a.shift();
        var b = _b.shift();
        var areEqual = false;
        if (comparor) {
          areEqual = tryCatch_1.tryCatch(comparor)(a, b);
          if (areEqual === errorObject_1.errorObject) {
            this.destination.error(errorObject_1.errorObject.e);
          }
        } else {
          areEqual = a === b;
        }
        if (!areEqual) {
          this.emit(false);
        }
      }
    };
    SequenceEqualSubscriber.prototype.emit = function(value) {
      var destination = this.destination;
      destination.next(value);
      destination.complete();
    };
    SequenceEqualSubscriber.prototype.nextB = function(value) {
      if (this._oneComplete && this._a.length === 0) {
        this.emit(false);
      } else {
        this._b.push(value);
        this.checkValues();
      }
    };
    return SequenceEqualSubscriber;
  }(Subscriber_1.Subscriber));
  exports.SequenceEqualSubscriber = SequenceEqualSubscriber;
  var SequenceEqualCompareToSubscriber = (function(_super) {
    __extends(SequenceEqualCompareToSubscriber, _super);
    function SequenceEqualCompareToSubscriber(destination, parent) {
      _super.call(this, destination);
      this.parent = parent;
    }
    SequenceEqualCompareToSubscriber.prototype._next = function(value) {
      this.parent.nextB(value);
    };
    SequenceEqualCompareToSubscriber.prototype._error = function(err) {
      this.parent.error(err);
    };
    SequenceEqualCompareToSubscriber.prototype._complete = function() {
      this.parent._complete();
    };
    return SequenceEqualCompareToSubscriber;
  }(Subscriber_1.Subscriber));
  