package com.google.android.gms.internal.ads;

import android.content.Context;
import android.os.Bundle;
import android.util.Pair;
import androidx.annotation.Nullable;
import java.util.concurrent.ScheduledExecutorService;

/* JADX INFO: loaded from: classes2.dex */
public final class p11 implements m11 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final hb1 f15231a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final h70 f15232b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Context f15233c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final vu0 f15234d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final nd1 f15235e;

    @Nullable
    private uc0 zzf;

    public p11(h70 h70Var, Context context, vu0 vu0Var, hb1 hb1Var) {
        this.f15232b = h70Var;
        this.f15233c = context;
        this.f15234d = vu0Var;
        this.f15231a = hb1Var;
        this.f15235e = h70Var.c();
        hb1Var.zzt((d11) vu0Var.f17779c);
    }

    @Override // com.google.android.gms.internal.ads.m11
    public final boolean zza(n7.a4 a4Var, String str, k11 k11Var, l11 l11Var) {
        md1 md1Var;
        tn tnVar = ao.Q2;
        n7.y yVar = n7.y.f31093e;
        if (((Boolean) yVar.f31096c.b(tnVar)).booleanValue()) {
            n7.x.a();
        }
        m7.n nVar = m7.n.C;
        p7.r0 r0Var = nVar.f30464c;
        Context context = this.f15233c;
        boolean zG = p7.r0.g(context);
        h70 h70Var = this.f15232b;
        final int i10 = 0;
        final int i11 = 1;
        if (zG && a4Var.zzs == null) {
            q7.j.b("Failed to load the ad because app ID is missing.");
            h70Var.b().execute(new Runnable(this) { // from class: com.google.android.gms.internal.ads.o11

                /* JADX INFO: renamed from: b, reason: collision with root package name */
                public final /* synthetic */ p11 f14804b;

                {
                    this.f14804b = this;
                }

                @Override // java.lang.Runnable
                public final void run() {
                    int i12 = i11;
                    p11 p11Var = this.f14804b;
                    switch (i12) {
                        case 0:
                            ((xe0) p11Var.f15234d.f17780d).q(sb1.zzd(6, null, null));
                            break;
                        default:
                            ((xe0) p11Var.f15234d.f17780d).q(sb1.zzd(4, null, null));
                            break;
                    }
                }
            });
            return false;
        }
        if (str == null) {
            q7.j.b("Ad unit ID should not be null for NativeAdLoader.");
            h70Var.b().execute(new Runnable(this) { // from class: com.google.android.gms.internal.ads.o11

                /* JADX INFO: renamed from: b, reason: collision with root package name */
                public final /* synthetic */ p11 f14804b;

                {
                    this.f14804b = this;
                }

                @Override // java.lang.Runnable
                public final void run() {
                    int i12 = i10;
                    p11 p11Var = this.f14804b;
                    switch (i12) {
                        case 0:
                            ((xe0) p11Var.f15234d.f17780d).q(sb1.zzd(6, null, null));
                            break;
                        default:
                            ((xe0) p11Var.f15234d.f17780d).q(sb1.zzd(4, null, null));
                            break;
                    }
                }
            });
            return false;
        }
        boolean z10 = a4Var.f30898f;
        ni.s(context, z10);
        if (((Boolean) yVar.f31096c.b(ao.f8856fa)).booleanValue() && z10) {
            ((ps0) ((a80) h70Var).D.zzb()).b(true);
        }
        int i12 = ((n11) k11Var).f14401a;
        nVar.f30472k.getClass();
        long jCurrentTimeMillis = System.currentTimeMillis();
        String strA = zzdxh.PUBLIC_API_CALL.a();
        Long lValueOf = Long.valueOf(jCurrentTimeMillis);
        Bundle bundleA = ni.a(new Pair(strA, lValueOf), new Pair(zzdxh.DYNAMITE_ENTER.a(), lValueOf));
        hb1 hb1Var = this.f15231a;
        hb1Var.f12104a = a4Var;
        hb1Var.f12118o = bundleA;
        hb1Var.f12113j = i12;
        ib1 ib1VarA = hb1Var.a();
        id1 id1VarF = id1.f(context, ni.I(ib1VarA), 8, a4Var);
        n7.g1 g1Var = ib1VarA.zzo;
        vu0 vu0Var = this.f15234d;
        if (g1Var != null) {
            ((d11) vu0Var.f17779c).i(g1Var);
        }
        x70 x70Var = new x70(((a80) h70Var).f8525c);
        fe0 fe0Var = new fe0();
        fe0Var.f11184a = context;
        fe0Var.f11185b = ib1VarA;
        x70Var.f18340e = new ge0(fe0Var);
        cj0 cj0Var = new cj0();
        cj0Var.b((d11) vu0Var.f17779c, h70Var.b());
        x70Var.f18339d = new dj0(cj0Var);
        x70Var.f18341f = new ml0((um0) vu0Var.f17778b, ((d11) vu0Var.f17779c).a());
        x70Var.f18342g = new bb0(null);
        y70 y70VarZzh = x70Var.zzh();
        if (((Boolean) ip.f12589c.j()).booleanValue()) {
            md1 md1Var2 = (md1) y70VarZzh.f18684e.zzb();
            md1Var2.i(8);
            md1Var2.c(a4Var.S);
            md1Var2.d(a4Var.f30905m);
            md1Var = md1Var2;
        } else {
            md1Var = null;
        }
        a80 a80Var = (a80) h70Var;
        ((rb1) a80Var.R.zzb()).a(1);
        a30 a30Var = b30.f9359a;
        vj1.i(a30Var);
        ScheduledExecutorService scheduledExecutorService = (ScheduledExecutorService) a80Var.f8529e.zzb();
        dd0 dd0Var = (dd0) y70VarZzh.F0.zzb();
        vc1 vc1VarC = dd0Var.c(dd0Var.b());
        uc0 uc0Var = new uc0(a30Var, scheduledExecutorService, vc1VarC);
        this.zzf = uc0Var;
        ih1.z1(vc1VarC, new sc0(uc0Var, new oa1(this, l11Var, md1Var, id1VarF, y70VarZzh), 0), a30Var);
        return true;
    }

    @Override // com.google.android.gms.internal.ads.m11
    public final boolean zzb() {
        uc0 uc0Var = this.zzf;
        return uc0Var != null && uc0Var.f17206c;
    }
}
