package com.bytedance.sdk.component.wsy;

import android.os.Bundle;
import com.bytedance.sdk.component.ro.fm.fm.fm.jnr;
import com.bytedance.sdk.component.ro.fm.ku;
import com.bytedance.sdk.component.ro.fm.wu;
import com.bytedance.sdk.component.wsy.lb.yz;
import com.bytedance.sdk.openadsdk.gof.yz;
import com.google.android.gms.measurement.internal.u1;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;

/* JADX INFO: loaded from: classes.dex */
public class fm {
    private static jnr fm;
    private static lb ro;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    private ku f6692lb;

    /* JADX INFO: renamed from: com.bytedance.sdk.component.wsy.fm$fm, reason: collision with other inner class name */
    public static final class C0042fm {
        private Set<String> ajl;
        private Bundle wsy;
        ro yz;
        final List<wu> jnr = new ArrayList();
        int fm = 10000;
        int ro = 10000;

        /* JADX INFO: renamed from: lb, reason: collision with root package name */
        int f6693lb = 10000;

        public C0042fm fm(ro roVar) {
            this.yz = roVar;
            return this;
        }

        public C0042fm lb(long j10, TimeUnit timeUnit) {
            this.f6693lb = fm("timeout", j10, timeUnit);
            return this;
        }

        public C0042fm fm(boolean z10) {
            return this;
        }

        public C0042fm ro(long j10, TimeUnit timeUnit) {
            this.ro = fm("timeout", j10, timeUnit);
            return this;
        }

        public C0042fm fm(long j10, TimeUnit timeUnit) {
            this.fm = fm("timeout", j10, timeUnit);
            return this;
        }

        public C0042fm fm(wu wuVar) {
            this.jnr.add(wuVar);
            return this;
        }

        private static int fm(String str, long j10, TimeUnit timeUnit) {
            if (j10 < 0) {
                throw new IllegalArgumentException(u1.j(str, " < 0"));
            }
            if (timeUnit != null) {
                long millis = timeUnit.toMillis(j10);
                if (millis > 2147483647L) {
                    throw new IllegalArgumentException(u1.j(str, " too large."));
                }
                if (millis != 0 || j10 <= 0) {
                    return (int) millis;
                }
                throw new IllegalArgumentException(u1.j(str, " too small."));
            }
            throw new NullPointerException("unit == null");
        }

        public fm fm() {
            return new fm(this);
        }
    }

    public interface lb {
        void fm(String str, String str2, String str3, int i10, String str4, boolean z10, int i11, int i12);

        boolean fm();

        boolean ro();
    }

    public interface ro {
        void fm(yz yzVar);

        void lb(yz yzVar);

        void ro(yz yzVar);
    }

    public static boolean ajl() {
        lb lbVar = ro;
        if (lbVar == null) {
            return false;
        }
        return lbVar.fm();
    }

    public static void fm(jnr jnrVar) {
        fm = jnrVar;
    }

    public static boolean jnr() {
        jnr jnrVar = fm;
        if (jnrVar == null) {
            return false;
        }
        return jnrVar.fm();
    }

    public static boolean wsy() {
        lb lbVar = ro;
        if (lbVar == null) {
            return false;
        }
        return lbVar.ro();
    }

    public com.bytedance.sdk.component.wsy.ro.ro lb() {
        return new com.bytedance.sdk.component.wsy.ro.ro(this.f6692lb);
    }

    public com.bytedance.sdk.component.wsy.ro.yz ro() {
        return new com.bytedance.sdk.component.wsy.ro.yz(this.f6692lb);
    }

    public ku wu() {
        return this.f6692lb;
    }

    public com.bytedance.sdk.component.wsy.ro.fm yz() {
        return new com.bytedance.sdk.component.wsy.ro.fm(this.f6692lb);
    }

    private fm(C0042fm c0042fm) {
        ku.fm fmVar = new ku.fm();
        long j10 = c0042fm.fm;
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        ku.fm fmVarRo = fmVar.fm(j10, timeUnit).lb(c0042fm.f6693lb, timeUnit).ro(c0042fm.ro, timeUnit);
        List<wu> list = c0042fm.jnr;
        if (list != null && list.size() > 0) {
            Iterator<wu> it = c0042fm.jnr.iterator();
            while (it.hasNext()) {
                fmVarRo.fm(it.next());
            }
        }
        if (c0042fm.wsy != null) {
            Bundle unused = c0042fm.wsy;
        }
        Set unused2 = c0042fm.ajl;
        fmVarRo.fm(c0042fm.yz);
        this.f6692lb = fmVarRo.fm();
    }

    public static void fm(lb lbVar) {
        ro = lbVar;
    }

    public static void fm() {
        com.bytedance.sdk.component.wsy.lb.yz.fm(yz.fm.DEBUG);
    }

    public static void fm(String str, String str2, String str3, int i10, String str4, boolean z10, int i11, int i12) {
        lb lbVar = ro;
        if (lbVar == null) {
            return;
        }
        lbVar.fm(str, str2, str3, i10, str4, z10, i11, i12);
    }
}
