package ar;

import java.util.List;
import kotlin.jvm.internal.t;
import uq.b0;
import uq.d0;
import uq.w;

/* loaded from: classes3.dex */
public final class g implements w.a {

    /* renamed from: a, reason: collision with root package name */
    private final zq.h f6177a;

    /* renamed from: b, reason: collision with root package name */
    private final List f6178b;

    /* renamed from: c, reason: collision with root package name */
    private final int f6179c;

    /* renamed from: d, reason: collision with root package name */
    private final zq.c f6180d;

    /* renamed from: e, reason: collision with root package name */
    private final b0 f6181e;

    /* renamed from: f, reason: collision with root package name */
    private final int f6182f;

    /* renamed from: g, reason: collision with root package name */
    private final int f6183g;

    /* renamed from: h, reason: collision with root package name */
    private final int f6184h;

    /* renamed from: i, reason: collision with root package name */
    private int f6185i;

    public g(zq.h call, List interceptors, int i10, zq.c cVar, b0 request, int i11, int i12, int i13) {
        t.g(call, "call");
        t.g(interceptors, "interceptors");
        t.g(request, "request");
        this.f6177a = call;
        this.f6178b = interceptors;
        this.f6179c = i10;
        this.f6180d = cVar;
        this.f6181e = request;
        this.f6182f = i11;
        this.f6183g = i12;
        this.f6184h = i13;
    }

    public static /* synthetic */ g d(g gVar, int i10, zq.c cVar, b0 b0Var, int i11, int i12, int i13, int i14, Object obj) {
        if ((i14 & 1) != 0) {
            i10 = gVar.f6179c;
        }
        if ((i14 & 2) != 0) {
            cVar = gVar.f6180d;
        }
        zq.c cVar2 = cVar;
        if ((i14 & 4) != 0) {
            b0Var = gVar.f6181e;
        }
        b0 b0Var2 = b0Var;
        if ((i14 & 8) != 0) {
            i11 = gVar.f6182f;
        }
        int i15 = i11;
        if ((i14 & 16) != 0) {
            i12 = gVar.f6183g;
        }
        int i16 = i12;
        if ((i14 & 32) != 0) {
            i13 = gVar.f6184h;
        }
        return gVar.c(i10, cVar2, b0Var2, i15, i16, i13);
    }

    @Override // uq.w.a
    public uq.j a() {
        zq.c cVar = this.f6180d;
        if (cVar != null) {
            return cVar.h();
        }
        return null;
    }

    @Override // uq.w.a
    public d0 b(b0 request) {
        t.g(request, "request");
        if (!(this.f6179c < this.f6178b.size())) {
            throw new IllegalStateException("Check failed.".toString());
        }
        this.f6185i++;
        zq.c cVar = this.f6180d;
        if (cVar != null) {
            if (!cVar.j().b().b(request.k())) {
                throw new IllegalStateException(("network interceptor " + this.f6178b.get(this.f6179c - 1) + " must retain the same host and port").toString());
            }
            if (!(this.f6185i == 1)) {
                throw new IllegalStateException(("network interceptor " + this.f6178b.get(this.f6179c - 1) + " must call proceed() exactly once").toString());
            }
        }
        g d10 = d(this, this.f6179c + 1, null, request, 0, 0, 0, 58, null);
        w wVar = (w) this.f6178b.get(this.f6179c);
        d0 intercept = wVar.intercept(d10);
        if (intercept == null) {
            throw new NullPointerException("interceptor " + wVar + " returned null");
        }
        if (this.f6180d != null) {
            if (!(this.f6179c + 1 >= this.f6178b.size() || d10.f6185i == 1)) {
                throw new IllegalStateException(("network interceptor " + wVar + " must call proceed() exactly once").toString());
            }
        }
        return intercept;
    }

    public final g c(int i10, zq.c cVar, b0 request, int i11, int i12, int i13) {
        t.g(request, "request");
        return new g(this.f6177a, this.f6178b, i10, cVar, request, i11, i12, i13);
    }

    @Override // uq.w.a
    public uq.e call() {
        return this.f6177a;
    }

    public final zq.h e() {
        return this.f6177a;
    }

    public final zq.c f() {
        return this.f6180d;
    }

    @Override // uq.w.a
    public b0 g() {
        return this.f6181e;
    }

    public final int h() {
        return this.f6183g;
    }

    public final b0 i() {
        return this.f6181e;
    }

    public final int j() {
        return this.f6184h;
    }

    public int k() {
        return this.f6183g;
    }
}
