package r9; import java.util.List; import n9.e0; import n9.g0; import n9.z; /* loaded from: classes2.dex */ public final class g implements z.a { /* renamed from: a, reason: collision with root package name */ private final List f13750a; /* renamed from: b, reason: collision with root package name */ private final q9.k f13751b; /* renamed from: c, reason: collision with root package name */ private final q9.c f13752c; /* renamed from: d, reason: collision with root package name */ private final int f13753d; /* renamed from: e, reason: collision with root package name */ private final e0 f13754e; /* renamed from: f, reason: collision with root package name */ private final n9.g f13755f; /* renamed from: g, reason: collision with root package name */ private final int f13756g; /* renamed from: h, reason: collision with root package name */ private final int f13757h; /* renamed from: i, reason: collision with root package name */ private final int f13758i; /* renamed from: j, reason: collision with root package name */ private int f13759j; public g(List list, q9.k kVar, q9.c cVar, int i10, e0 e0Var, n9.g gVar, int i11, int i12, int i13) { this.f13750a = list; this.f13751b = kVar; this.f13752c = cVar; this.f13753d = i10; this.f13754e = e0Var; this.f13755f = gVar; this.f13756g = i11; this.f13757h = i12; this.f13758i = i13; } @Override // n9.z.a public int a() { return this.f13757h; } @Override // n9.z.a public int b() { return this.f13758i; } @Override // n9.z.a public int c() { return this.f13756g; } @Override // n9.z.a public e0 d() { return this.f13754e; } @Override // n9.z.a public g0 e(e0 e0Var) { return g(e0Var, this.f13751b, this.f13752c); } public q9.c f() { q9.c cVar = this.f13752c; if (cVar != null) { return cVar; } throw new IllegalStateException(); } public g0 g(e0 e0Var, q9.k kVar, q9.c cVar) { if (this.f13753d >= this.f13750a.size()) { throw new AssertionError(); } this.f13759j++; q9.c cVar2 = this.f13752c; if (cVar2 != null && !cVar2.c().u(e0Var.h())) { throw new IllegalStateException("network interceptor " + this.f13750a.get(this.f13753d - 1) + " must retain the same host and port"); } if (this.f13752c != null && this.f13759j > 1) { throw new IllegalStateException("network interceptor " + this.f13750a.get(this.f13753d - 1) + " must call proceed() exactly once"); } g gVar = new g(this.f13750a, kVar, cVar, this.f13753d + 1, e0Var, this.f13755f, this.f13756g, this.f13757h, this.f13758i); z zVar = (z) this.f13750a.get(this.f13753d); g0 a10 = zVar.a(gVar); if (cVar != null && this.f13753d + 1 < this.f13750a.size() && gVar.f13759j != 1) { throw new IllegalStateException("network interceptor " + zVar + " must call proceed() exactly once"); } if (a10 == null) { throw new NullPointerException("interceptor " + zVar + " returned null"); } if (a10.c() != null) { return a10; } throw new IllegalStateException("interceptor " + zVar + " returned a response with no body"); } public q9.k h() { return this.f13751b; } }