package uq;

import com.google.firebase.perf.FirebasePerformance;
import java.net.URL;
import java.util.Map;
import sm.n0;
import uq.u;
import uq.v;

/* loaded from: classes3.dex */
public final class b0 {

    /* renamed from: a, reason: collision with root package name */
    private final v f37385a;

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

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

    /* renamed from: d, reason: collision with root package name */
    private final c0 f37388d;

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

    /* renamed from: f, reason: collision with root package name */
    private d f37390f;

    public b0(a builder) {
        kotlin.jvm.internal.t.g(builder, "builder");
        v k10 = builder.k();
        if (k10 == null) {
            throw new IllegalStateException("url == null".toString());
        }
        this.f37385a = k10;
        this.f37386b = builder.i();
        this.f37387c = builder.h().e();
        this.f37388d = builder.g();
        this.f37389e = n0.u(builder.j());
    }

    public final c0 a() {
        return this.f37388d;
    }

    public final d b() {
        d dVar = this.f37390f;
        if (dVar != null) {
            return dVar;
        }
        d a10 = d.f37397n.a(this.f37387c);
        this.f37390f = a10;
        return a10;
    }

    public final Map c() {
        return this.f37389e;
    }

    public final String d(String name) {
        kotlin.jvm.internal.t.g(name, "name");
        return vq.j.f(this, name);
    }

    public final u e() {
        return this.f37387c;
    }

    public final boolean f() {
        return this.f37385a.j();
    }

    public final String g() {
        return this.f37386b;
    }

    public final a h() {
        return new a(this);
    }

    public final Object i(Class type) {
        kotlin.jvm.internal.t.g(type, "type");
        return j(cn.a.e(type));
    }

    public final Object j(kn.d type) {
        kotlin.jvm.internal.t.g(type, "type");
        return cn.a.b(type).cast(this.f37389e.get(type));
    }

    public final v k() {
        return this.f37385a;
    }

    public String toString() {
        StringBuilder sb2 = new StringBuilder();
        sb2.append("Request{method=");
        sb2.append(this.f37386b);
        sb2.append(", url=");
        sb2.append(this.f37385a);
        if (this.f37387c.size() != 0) {
            sb2.append(", headers=[");
            int i10 = 0;
            for (Object obj : this.f37387c) {
                int i11 = i10 + 1;
                if (i10 < 0) {
                    sm.s.u();
                }
                rm.v vVar = (rm.v) obj;
                String str = (String) vVar.a();
                String str2 = (String) vVar.b();
                if (i10 > 0) {
                    sb2.append(", ");
                }
                sb2.append(str);
                sb2.append(':');
                if (vq.m.y(str)) {
                    str2 = "██";
                }
                sb2.append(str2);
                i10 = i11;
            }
            sb2.append(']');
        }
        if (!this.f37389e.isEmpty()) {
            sb2.append(", tags=");
            sb2.append(this.f37389e);
        }
        sb2.append('}');
        String sb3 = sb2.toString();
        kotlin.jvm.internal.t.f(sb3, "StringBuilder().apply(builderAction).toString()");
        return sb3;
    }

    /* loaded from: classes3.dex */
    public static class a {

        /* renamed from: a, reason: collision with root package name */
        private v f37391a;

        /* renamed from: b, reason: collision with root package name */
        private String f37392b;

        /* renamed from: c, reason: collision with root package name */
        private u.a f37393c;

        /* renamed from: d, reason: collision with root package name */
        private c0 f37394d;

        /* renamed from: e, reason: collision with root package name */
        private Map f37395e;

        public a() {
            this.f37395e = n0.i();
            this.f37392b = FirebasePerformance.HttpMethod.GET;
            this.f37393c = new u.a();
        }

        public static /* synthetic */ a e(a aVar, c0 c0Var, int i10, Object obj) {
            if (obj != null) {
                throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: delete");
            }
            if ((i10 & 1) != 0) {
                c0Var = vq.m.l();
            }
            return aVar.d(c0Var);
        }

        public a A(v url) {
            kotlin.jvm.internal.t.g(url, "url");
            this.f37391a = url;
            return this;
        }

        public a a(String name, String value) {
            kotlin.jvm.internal.t.g(name, "name");
            kotlin.jvm.internal.t.g(value, "value");
            return vq.j.b(this, name, value);
        }

        public b0 b() {
            return new b0(this);
        }

        public final a c() {
            return e(this, null, 1, null);
        }

        public a d(c0 c0Var) {
            return vq.j.c(this, c0Var);
        }

        public a f() {
            return vq.j.d(this);
        }

        public final c0 g() {
            return this.f37394d;
        }

        public final u.a h() {
            return this.f37393c;
        }

        public final String i() {
            return this.f37392b;
        }

        public final Map j() {
            return this.f37395e;
        }

        public final v k() {
            return this.f37391a;
        }

        public a l() {
            return vq.j.e(this);
        }

        public a m(String name, String value) {
            kotlin.jvm.internal.t.g(name, "name");
            kotlin.jvm.internal.t.g(value, "value");
            return vq.j.g(this, name, value);
        }

        public a n(u headers) {
            kotlin.jvm.internal.t.g(headers, "headers");
            return vq.j.h(this, headers);
        }

        public a o(String method, c0 c0Var) {
            kotlin.jvm.internal.t.g(method, "method");
            return vq.j.i(this, method, c0Var);
        }

        public a p(c0 body) {
            kotlin.jvm.internal.t.g(body, "body");
            return vq.j.j(this, body);
        }

        public a q(c0 body) {
            kotlin.jvm.internal.t.g(body, "body");
            return vq.j.k(this, body);
        }

        public a r(c0 body) {
            kotlin.jvm.internal.t.g(body, "body");
            return vq.j.l(this, body);
        }

        public a s(String name) {
            kotlin.jvm.internal.t.g(name, "name");
            return vq.j.m(this, name);
        }

        public final void t(c0 c0Var) {
            this.f37394d = c0Var;
        }

        public final void u(u.a aVar) {
            kotlin.jvm.internal.t.g(aVar, "<set-?>");
            this.f37393c = aVar;
        }

        public final void v(String str) {
            kotlin.jvm.internal.t.g(str, "<set-?>");
            this.f37392b = str;
        }

        public final void w(Map map) {
            kotlin.jvm.internal.t.g(map, "<set-?>");
            this.f37395e = map;
        }

        public a x(Class type, Object obj) {
            kotlin.jvm.internal.t.g(type, "type");
            return vq.j.n(this, cn.a.e(type), obj);
        }

        public a y(String url) {
            kotlin.jvm.internal.t.g(url, "url");
            return A(v.f37599k.d(vq.j.a(url)));
        }

        public a z(URL url) {
            kotlin.jvm.internal.t.g(url, "url");
            v.b bVar = v.f37599k;
            String url2 = url.toString();
            kotlin.jvm.internal.t.f(url2, "url.toString()");
            return A(bVar.d(url2));
        }

        public a(b0 request) {
            kotlin.jvm.internal.t.g(request, "request");
            this.f37395e = n0.i();
            this.f37391a = request.k();
            this.f37392b = request.g();
            this.f37394d = request.a();
            this.f37395e = request.c().isEmpty() ? n0.i() : n0.w(request.c());
            this.f37393c = request.e().r();
        }
    }
}
