package d3;

import android.os.Bundle;
import android.text.TextUtils;
import java.util.Iterator;

/* JADX INFO: loaded from: classes.dex */
public final class r {

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

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

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

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

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

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final C0825u f12120f;

    public r(C0817r0 c0817r0, String str, String str2, String str3, long j8, long j9, Bundle bundle) {
        C0825u c0825u;
        P2.w.c(str2);
        P2.w.c(str3);
        this.f12115a = str2;
        this.f12116b = str3;
        this.f12117c = true == TextUtils.isEmpty(str) ? null : str;
        this.f12118d = j8;
        this.f12119e = j9;
        if (j9 != 0 && j9 > j8) {
            Z z8 = c0817r0.f12150y;
            C0817r0.k(z8);
            z8.f11878y.c(Z.M(str2), "Event created with reverse previous/current timestamps. appId");
        }
        if (bundle == null || bundle.isEmpty()) {
            c0825u = new C0825u(new Bundle());
        } else {
            Bundle bundle2 = new Bundle(bundle);
            Iterator<String> it = bundle2.keySet().iterator();
            while (it.hasNext()) {
                String next = it.next();
                if (next == null) {
                    Z z9 = c0817r0.f12150y;
                    C0817r0.k(z9);
                    z9.f11875v.b("Param name can't be null");
                    it.remove();
                } else {
                    W1 w12 = c0817r0.f12122B;
                    C0817r0.i(w12);
                    Object objL = w12.L(bundle2.get(next), next);
                    if (objL == null) {
                        Z z10 = c0817r0.f12150y;
                        C0817r0.k(z10);
                        z10.f11878y.c(c0817r0.f12123C.e(next), "Param value can't be null");
                        it.remove();
                    } else {
                        W1 w13 = c0817r0.f12122B;
                        C0817r0.i(w13);
                        w13.Z(bundle2, next, objL);
                    }
                }
            }
            c0825u = new C0825u(bundle2);
        }
        this.f12120f = c0825u;
    }

    public final r a(C0817r0 c0817r0, long j8) {
        return new r(c0817r0, this.f12117c, this.f12115a, this.f12116b, this.f12118d, j8, this.f12120f);
    }

    public final String toString() {
        return "Event{appId='" + this.f12115a + "', name='" + this.f12116b + "', params=" + this.f12120f.toString() + "}";
    }

    public r(C0817r0 c0817r0, String str, String str2, String str3, long j8, long j9, C0825u c0825u) {
        P2.w.c(str2);
        P2.w.c(str3);
        P2.w.f(c0825u);
        this.f12115a = str2;
        this.f12116b = str3;
        this.f12117c = true == TextUtils.isEmpty(str) ? null : str;
        this.f12118d = j8;
        this.f12119e = j9;
        if (j9 != 0 && j9 > j8) {
            Z z8 = c0817r0.f12150y;
            C0817r0.k(z8);
            z8.f11878y.d("Event created with reverse previous/current timestamps. appId, name", Z.M(str2), Z.M(str3));
        }
        this.f12120f = c0825u;
    }
}
