text: /* */ 
  "format cjs";
  (function(a) {
    var b = {
      "boolean": !1,
      "function": !0,
      object: !0,
      number: !1,
      string: !1,
      undefined: !1
    },
        c = b[typeof window] && window || this,
        d = b[typeof exports] && exports && !exports.nodeType && exports,
        e = b[typeof module] && module && !module.nodeType && module,
        f = (e && e.exports === d && d, b[typeof global] && global);
    !f || f.global !== f && f.window !== f || (c = f), "function" == typeof define && define.amd ? define(["rx"], function(b, d) {
      return a(c, d, b);
    }) : "object" == typeof module && module && module.exports === d ? module.exports = a(c, module.exports, require("./rx")) : c.Rx = a(c, {}, c.Rx);
  }).call(this, function(a, b, c, d) {
    function e(a) {
      for (var b = a.length,
          c = new Array(b),
          d = 0; b > d; d++)
        c[d] = a[d];
      return c;
    }
    var f = c.Observable,
        g = f.prototype,
        h = c.AnonymousObservable,
        i = c.Subject,
        j = c.AsyncSubject,
        k = c.Observer,
        l = c.internals.ScheduledObserver,
        m = c.Disposable.create,
        n = c.Disposable.empty,
        o = c.CompositeDisposable,
        p = c.Scheduler.currentThread,
        q = c.helpers.isFunction,
        r = c.internals.inherits,
        s = c.internals.addProperties,
        t = c.Disposable.checkDisposed;
    g.multicast = function(a, b) {
      var c = this;
      return "function" == typeof a ? new h(function(d) {
        var e = c.multicast(a());
        return new o(b(e).subscribe(d), e.connect());
      }, c) : new x(c, a);
    }, g.publish = function(a) {
      return a && q(a) ? this.multicast(function() {
        return new i;
      }, a) : this.multicast(new i);
    }, g.share = function() {
      return this.publish().refCount();
    }, g.publishLast = function(a) {
      return a && q(a) ? this.multicast(function() {
        return new j;
      }, a) : this.multicast(new j);
    }, g.publishValue = function(a, b) {
      return 2 === arguments.length ? this.multicast(function() {
        return new v(b);
      }, a) : this.multicast(new v(a));
    }, g.shareValue = function(a) {
      return this.publishValue(a).refCount();
    }, g.replay = function(a, b, c, d) {
      return a && q(a) ? this.multicast(function() {
        return new w(b, c, d);
      }, a) : this.multicast(new w(b, c, d));
    }, g.shareReplay = function(a, b, c) {
      return this.replay(null, a, b, c).refCount();
    };
    var u = function(a, b) {
      this.subject = a, this.observer = b;
    };
    u.prototype.dispose = function() {
      if (!this.subject.isDisposed && null !== this.observer) {
        var a = this.subject.observers.indexOf(this.observer);
        this.subject.observers.splice(a, 1), this.observer = null;
      }
    };
    var v = c.BehaviorSubject = function(a) {
      function b(a) {
        return t(this), this.isStopped ? (this.hasError ? a.onError(this.error) : a.onCompleted(), n) : (this.observers.push(a), a.onNext(this.value), new u(this, a));
      }
      function c(c) {
        a.call(this, b), this.value = c, this.observers = [], this.isDisposed = !1, this.isStopped = !1, this.hasError = !1;
      }
      return r(c, a), s(c.prototype, k, {
        getValue: function() {
          if (t(this), this.hasError)
            throw this.error;
          return this.value;
        },
        hasObservers: function() {
          return this.observers.length > 0;
        },
        onCompleted: function() {
          if (t(this), !this.isStopped) {
            this.isStopped = !0;
            for (var a = 0,
                b = e(this.observers),
                c = b.length; c > a; a++)
              b[a].onCompleted();
            this.observers.length = 0;
          }
        },
        onError: function(a) {
          if (t(this), !this.isStopped) {
            this.isStopped = !0, this.hasError = !0, this.error = a;
            for (var b = 0,
                c = e(this.observers),
                d = c.length; d > b; b++)
              c[b].onError(a);
            this.observers.length = 0;
          }
        },
        onNext: function(a) {
          if (t(this), !this.isStopped) {
            this.value = a;
            for (var b = 0,
                c = e(this.observers),
                d = c.length; d > b; b++)
              c[b].onNext(a);
          }
        },
        dispose: function() {
          this.isDisposed = !0, this.observers = null, this.value = null, this.exception = null;
        }
      }), c;
    }(f),
        w = c.ReplaySubject = function(a) {
          function b(a, b) {
            return m(function() {
              b.dispose(), !a.isDisposed && a.observers.splice(a.observers.indexOf(b), 1);
            });
          }
          function c(a) {
            var c = new l(this.scheduler, a),
                d = b(this, c);
            t(this), this._trim(this.scheduler.now()), this.observers.push(c);
            for (var e = 0,
                f = this.q.length; f > e; e++)
              c.onNext(this.q[e].value);
            return this.hasError ? c.onError(this.error) : this.isStopped && c.onCompleted(), c.ensureActive(), d;
          }
          function d(b, d, e) {
            this.bufferSize = null == b ? f : b, this.windowSize = null == d ? f : d, this.scheduler = e || p, this.q = [], this.observers = [], this.isStopped = !1, this.isDisposed = !1, this.hasError = !1, this.error = null, a.call(this, c);
          }
          var f = Math.pow(2, 53) - 1;
          return r(d, a), s(d.prototype, k.prototype, {
            hasObservers: function() {
              return this.observers.length > 0;
            },
            _trim: function(a) {
              for (; this.q.length > this.bufferSize; )
                this.q.shift();
              for (; this.q.length > 0 && a - this.q[0].interval > this.windowSize; )
                this.q.shift();
            },
            onNext: function(a) {
              if (t(this), !this.isStopped) {
                var b = this.scheduler.now();
                this.q.push({
                  interval: b,
                  value: a
                }), this._trim(b);
                for (var c = 0,
                    d = e(this.observers),
                    f = d.length; f > c; c++) {
                  var g = d[c];
                  g.onNext(a), g.ensureActive();
                }
              }
            },
            onError: function(a) {
              if (t(this), !this.isStopped) {
                this.isStopped = !0, this.error = a, this.hasError = !0;
                var b = this.scheduler.now();
                this._trim(b);
                for (var c = 0,
                    d = e(this.observers),
                    f = d.length; f > c; c++) {
                  var g = d[c];
                  g.onError(a), g.ensureActive();
                }
                this.observers.length = 0;
              }
            },
            onCompleted: function() {
              if (t(this), !this.isStopped) {
                this.isStopped = !0;
                var a = this.scheduler.now();
                this._trim(a);
                for (var b = 0,
                    c = e(this.observers),
                    d = c.length; d > b; b++) {
                  var f = c[b];
                  f.onCompleted(), f.ensureActive();
                }
                this.observers.length = 0;
              }
            },
            dispose: function() {
              this.isDisposed = !0, this.observers = null;
            }
          }), d;
        }(f),
        x = c.ConnectableObservable = function(a) {
          function b(b, c) {
            var d,
                e = !1,
                f = b.asObservable();
            this.connect = function() {
              return e || (e = !0, d = new o(f.subscribe(c), m(function() {
                e = !1;
              }))), d;
            }, a.call(this, function(a) {
              return c.subscribe(a);
            });
          }
          return r(b, a), b.prototype.refCount = function() {
            var a,
                b = 0,
                c = this;
            return new h(function(d) {
              var e = 1 === ++b,
                  f = c.subscribe(d);
              return e && (a = c.connect()), function() {
                f.dispose(), 0 === --b && a.dispose();
              };
            });
          }, b;
        }(f);
    return g.singleInstance = function() {
      function a() {
        return d || (d = !0, b = c["finally"](function() {
          d = !1;
        }).publish().refCount()), b;
      }
      var b,
          c = this,
          d = !1;
      return new h(function(b) {
        return a().subscribe(b);
      });
    }, c;
  });
  