package o; /* loaded from: classes6.dex */ public final class fVO extends AbstractC13159fSg implements InterfaceC13204fTr { private InterfaceC13169fSq a; private long d; public fVO(InterfaceC13169fSq interfaceC13169fSq, long j) { this.a = interfaceC13169fSq; this.d = j; } @Override // o.AbstractC13159fSg public final void a(InterfaceC13161fSi interfaceC13161fSi) { this.a.subscribe(new HBt(interfaceC13161fSi, this.d)); } @Override // o.InterfaceC13204fTr public final AbstractC13163fSk b() { return new fVL(this.a, this.d, null, false); } /* loaded from: classes6.dex */ static final class HBt implements InterfaceC13174fSv, fSJ { private long a; private InterfaceC13161fSi b; private boolean c; private fSJ d; private long e; HBt(InterfaceC13161fSi interfaceC13161fSi, long j) { this.b = interfaceC13161fSi; this.e = j; } @Override // o.InterfaceC13174fSv public final void onSubscribe(fSJ fsj) { if (EnumC13192fTf.d(this.d, fsj)) { this.d = fsj; this.b.onSubscribe(this); } } @Override // o.fSJ public final void dispose() { this.d.dispose(); } @Override // o.fSJ public final boolean isDisposed() { return this.d.isDisposed(); } @Override // o.InterfaceC13174fSv public final void onNext(T t) { if (this.c) { return; } long j = this.a; if (j != this.e) { this.a = j + 1; return; } this.c = true; this.d.dispose(); this.b.e(t); } @Override // o.InterfaceC13174fSv public final void onError(Throwable th) { if (this.c) { C13418fZu.c(th); } else { this.c = true; this.b.onError(th); } } @Override // o.InterfaceC13174fSv public final void onComplete() { if (this.c) { return; } this.c = true; this.b.onComplete(); } } }