package G4;

import android.os.Looper;
import e4.C0572p;
import java.util.Arrays;
import java.util.Iterator;
import java.util.ServiceConfigurationError;
import r4.AbstractC0983h;
import z4.C1157a;

/* JADX INFO: loaded from: classes.dex */
public abstract class n {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final C4.c f859a;

    static {
        String property;
        int i = u.f867a;
        Object next = null;
        try {
            property = System.getProperty("kotlinx.coroutines.fast.service.loader");
        } catch (SecurityException unused) {
            property = null;
        }
        if (property != null) {
            Boolean.parseBoolean(property);
        }
        try {
            Iterator it = Arrays.asList(new C4.a()).iterator();
            AbstractC0983h.e("<this>", it);
            Iterator it2 = z4.i.K(new C1157a(new C0572p(2, it))).iterator();
            if (it2.hasNext()) {
                next = it2.next();
                if (it2.hasNext()) {
                    ((C4.a) next).getClass();
                    do {
                        ((C4.a) it2.next()).getClass();
                    } while (it2.hasNext());
                }
            }
            if (((C4.a) next) == null) {
                throw new IllegalStateException("Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core'");
            }
            Looper mainLooper = Looper.getMainLooper();
            if (mainLooper == null) {
                throw new IllegalStateException("The main looper is not available");
            }
            f859a = new C4.c(C4.d.a(mainLooper), false);
        } catch (Throwable th) {
            throw new ServiceConfigurationError(th.getMessage(), th);
        }
    }
}
