package defpackage;

import com.google.android.gms.internal.measurement.zzd;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.TreeMap;
import java.util.concurrent.Callable;

/* renamed from: ˋᵛˏ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C1503 {

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public final C1601 f6039;

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final C0030 f6040;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public C0030 f6041;

    /* renamed from: ᵻᵢﹳᵰ, reason: contains not printable characters */
    public final C1557 f6042;

    public C1503() {
        C0030 c0030 = new C0030(8);
        this.f6040 = c0030;
        this.f6041 = ((C0030) c0030.f1155).m1025();
        this.f6039 = new C1601(7);
        C1557 c1557 = new C1557();
        c1557.f6205 = new TreeMap();
        c1557.f6204 = new TreeMap();
        this.f6042 = c1557;
        final int i = 1;
        Callable callable = new Callable(this) { // from class: ᵜᵞ

            /* renamed from: ᵴᵳ, reason: contains not printable characters */
            public final /* synthetic */ C1503 f10919;

            {
                this.f10919 = this;
            }

            @Override // java.util.concurrent.Callable
            public final /* synthetic */ Object call() {
                int i2 = i;
                C1503 c1503 = this.f10919;
                switch (i2) {
                    case 0:
                        return new C3233(c1503.f6039);
                    default:
                        return new C3233(c1503.f6042);
                }
            }
        };
        C5082 c5082 = (C5082) c0030.f1152;
        c5082.f19006.put("internal.registerCallback", callable);
        final int i2 = 0;
        c5082.f19006.put("internal.eventLogger", new Callable(this) { // from class: ᵜᵞ

            /* renamed from: ᵴᵳ, reason: contains not printable characters */
            public final /* synthetic */ C1503 f10919;

            {
                this.f10919 = this;
            }

            @Override // java.util.concurrent.Callable
            public final /* synthetic */ Object call() {
                int i22 = i2;
                C1503 c1503 = this.f10919;
                switch (i22) {
                    case 0:
                        return new C3233(c1503.f6039);
                    default:
                        return new C3233(c1503.f6042);
                }
            }
        });
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final boolean m4432(C4587 c4587) throws zzd {
        C1601 c1601 = this.f6039;
        try {
            c1601.f6352 = c4587;
            c1601.f6355 = c4587.clone();
            ((ArrayList) c1601.f6354).clear();
            ((C0030) this.f6040.f1154).m1026("runtime.counter", new C0845(Double.valueOf(0.0d)));
            this.f6042.m4519(this.f6041.m1025(), c1601);
            if (((C4587) c1601.f6355).equals((C4587) c1601.f6352)) {
                return !((ArrayList) c1601.f6354).isEmpty();
            }
            return true;
        } catch (Throwable th) {
            throw new zzd(th);
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final void m4433(C4438 c4438) {
        AbstractC1149 abstractC1149;
        try {
            C0030 c0030 = this.f6040;
            this.f6041 = ((C0030) c0030.f1155).m1025();
            if (c0030.m1030(this.f6041, (C0393[]) c4438.m9468().toArray(new C0393[0])) instanceof C3216) {
                throw new IllegalStateException("Program loading failed");
            }
            for (C1004 c1004 : c4438.m9467().m10579()) {
                List listM3366 = c1004.m3366();
                String strM3367 = c1004.m3367();
                Iterator it = listM3366.iterator();
                while (it.hasNext()) {
                    InterfaceC0401 interfaceC0401M1030 = c0030.m1030(this.f6041, (C0393) it.next());
                    if (!(interfaceC0401M1030 instanceof C0302)) {
                        throw new IllegalArgumentException("Invalid rule definition");
                    }
                    C0030 c00302 = this.f6041;
                    if (c00302.m1024(strM3367)) {
                        InterfaceC0401 interfaceC0401M1022 = c00302.m1022(strM3367);
                        if (!(interfaceC0401M1022 instanceof AbstractC1149)) {
                            throw new IllegalStateException("Invalid function name: ".concat(String.valueOf(strM3367)));
                        }
                        abstractC1149 = (AbstractC1149) interfaceC0401M1022;
                    } else {
                        abstractC1149 = null;
                    }
                    if (abstractC1149 == null) {
                        throw new IllegalStateException("Rule function is undefined: ".concat(String.valueOf(strM3367)));
                    }
                    abstractC1149.mo1546(this.f6041, Collections.singletonList(interfaceC0401M1030));
                }
            }
        } catch (Throwable th) {
            throw new zzd(th);
        }
    }
}
