package g7;

import android.content.Context;
import android.os.RemoteException;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.gms.internal.ads.ey;
import com.google.android.gms.internal.ads.hs;
import com.google.android.gms.internal.ads.is;
import com.google.android.gms.internal.ads.kq;
import com.google.android.gms.internal.ads.uv;
import n7.h3;
import n7.i3;
import n7.n0;
import n7.u3;

/* JADX INFO: loaded from: classes2.dex */
public final class c {

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

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

    public c(Context context, String str) {
        if (context == null) {
            throw new NullPointerException("context cannot be null");
        }
        n7.u uVar = n7.x.f31085g.f31087b;
        uv uvVar = new uv();
        uVar.getClass();
        n0 n0Var = (n0) new n7.n(uVar, context, str, uvVar).a(context, false);
        this.f26275a = context;
        this.f26276b = n0Var;
    }

    public final d a() {
        Context context = this.f26275a;
        try {
            return new d(context, this.f26276b.zze());
        } catch (RemoteException unused) {
            return new d(context, new h3(new i3()));
        }
    }

    public final void b(com.google.android.gms.ads.nativead.d dVar) {
        try {
            this.f26276b.z1(new kq(4, dVar.f7980a, -1, dVar.f7982c, dVar.f7983d, dVar.getVideoOptions() != null ? new u3(dVar.getVideoOptions()) : null, dVar.f7985f, dVar.f7981b, dVar.f7987h, dVar.f7986g, dVar.f7988i - 1));
        } catch (RemoteException unused) {
        }
    }

    @NonNull
    public c forCustomFormatAd(@NonNull String str, @NonNull com.google.android.gms.ads.nativead.g gVar, @Nullable com.google.android.gms.ads.nativead.f fVar) {
        ey eyVar = new ey(gVar, fVar);
        try {
            this.f26276b.zzi(str, new hs(eyVar), eyVar.zzb());
        } catch (RemoteException unused) {
        }
        return this;
    }

    @Deprecated
    public final c zzb(String str, j7.g gVar, @Nullable j7.f fVar) {
        is isVar = new is(gVar, fVar);
        try {
            this.f26276b.zzi(str, new hs(isVar), isVar.zzb());
        } catch (RemoteException unused) {
        }
        return this;
    }
}
