package d3;

import android.os.Bundle;
import java.util.Iterator;
import q.C1441b;

/* JADX INFO: renamed from: d3.A, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0764A extends AbstractC0765B {

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final q.e f11420r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final q.e f11421s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public long f11422t;

    public C0764A(C0817r0 c0817r0) {
        super(c0817r0);
        this.f11421s = new q.e(0);
        this.f11420r = new q.e(0);
    }

    public final void F(long j8, String str) {
        C0817r0 c0817r0 = (C0817r0) this.f5146q;
        if (str == null || str.length() == 0) {
            Z z8 = c0817r0.f12150y;
            C0817r0.k(z8);
            z8.f11875v.b("Ad unit id must be a non-empty string");
        } else {
            C0815q0 c0815q0 = c0817r0.f12151z;
            C0817r0.k(c0815q0);
            c0815q0.O(new RunnableC0766a(this, str, j8, 0));
        }
    }

    public final void G(long j8, String str) {
        C0817r0 c0817r0 = (C0817r0) this.f5146q;
        if (str == null || str.length() == 0) {
            Z z8 = c0817r0.f12150y;
            C0817r0.k(z8);
            z8.f11875v.b("Ad unit id must be a non-empty string");
        } else {
            C0815q0 c0815q0 = c0817r0.f12151z;
            C0817r0.k(c0815q0);
            c0815q0.O(new RunnableC0766a(this, str, j8, 1));
        }
    }

    public final void H(long j8) {
        C0795j1 c0795j1 = ((C0817r0) this.f5146q).f12124E;
        C0817r0.j(c0795j1);
        C0786g1 c0786g1L = c0795j1.L(false);
        q.e eVar = this.f11420r;
        for (String str : (C1441b) eVar.keySet()) {
            J(str, j8 - ((Long) eVar.get(str)).longValue(), c0786g1L);
        }
        if (!eVar.isEmpty()) {
            I(j8 - this.f11422t, c0786g1L);
        }
        K(j8);
    }

    public final void I(long j8, C0786g1 c0786g1) {
        C0817r0 c0817r0 = (C0817r0) this.f5146q;
        if (c0786g1 == null) {
            Z z8 = c0817r0.f12150y;
            C0817r0.k(z8);
            z8.D.b("Not logging ad exposure. No active activity");
        } else {
            if (j8 < 1000) {
                Z z9 = c0817r0.f12150y;
                C0817r0.k(z9);
                z9.D.c(Long.valueOf(j8), "Not logging ad exposure. Less than 1000 ms. exposure");
                return;
            }
            Bundle bundle = new Bundle();
            bundle.putLong("_xt", j8);
            W1.U(c0786g1, bundle, true);
            Y0 y02 = c0817r0.f12125F;
            C0817r0.j(y02);
            y02.P("am", "_xa", bundle);
        }
    }

    public final void J(String str, long j8, C0786g1 c0786g1) {
        C0817r0 c0817r0 = (C0817r0) this.f5146q;
        if (c0786g1 == null) {
            Z z8 = c0817r0.f12150y;
            C0817r0.k(z8);
            z8.D.b("Not logging ad unit exposure. No active activity");
        } else {
            if (j8 < 1000) {
                Z z9 = c0817r0.f12150y;
                C0817r0.k(z9);
                z9.D.c(Long.valueOf(j8), "Not logging ad unit exposure. Less than 1000 ms. exposure");
                return;
            }
            Bundle bundle = new Bundle();
            bundle.putString("_ai", str);
            bundle.putLong("_xt", j8);
            W1.U(c0786g1, bundle, true);
            Y0 y02 = c0817r0.f12125F;
            C0817r0.j(y02);
            y02.P("am", "_xu", bundle);
        }
    }

    public final void K(long j8) {
        q.e eVar = this.f11420r;
        Iterator it = ((C1441b) eVar.keySet()).iterator();
        while (it.hasNext()) {
            eVar.put((String) it.next(), Long.valueOf(j8));
        }
        if (eVar.isEmpty()) {
            return;
        }
        this.f11422t = j8;
    }
}
