package wa;

import android.os.Bundle;
import com.google.android.gms.common.internal.w;
import com.google.android.gms.measurement.internal.c2;
import com.google.common.collect.ImmutableSet;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import xyz.stream.utils.f;
import xyz.stream.utils.t;

/* JADX INFO: loaded from: classes2.dex */
public final class e implements d {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static volatile e f34256c;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final s8.a f34257a;

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

    public e(s8.a aVar) {
        w.checkNotNull(aVar);
        this.f34257a = aVar;
        this.f34258b = new ConcurrentHashMap();
    }

    @Override // wa.d
    public final void clearConditionalUserProperty(String str, String str2, Bundle bundle) {
        if (str2 == null || xa.a.a(bundle, str2)) {
            this.f34257a.clearConditionalUserProperty(str, str2, bundle);
        }
    }

    @Override // wa.d
    public final List getConditionalUserProperties(String str, String str2) {
        ArrayList arrayList = new ArrayList();
        for (Bundle bundle : this.f34257a.getConditionalUserProperties(str, str2)) {
            ImmutableSet immutableSet = xa.a.f34752a;
            w.checkNotNull(bundle);
            c cVar = new c();
            cVar.value = c2.q(bundle, "value", Object.class, null);
            cVar.triggerEventName = (String) c2.q(bundle, "trigger_event_name", String.class, null);
            ((Long) c2.q(bundle, "trigger_timeout", Long.class, 0L)).longValue();
            cVar.timedOutEventName = (String) c2.q(bundle, "timed_out_event_name", String.class, null);
            cVar.timedOutEventParams = (Bundle) c2.q(bundle, "timed_out_event_params", Bundle.class, null);
            cVar.triggeredEventName = (String) c2.q(bundle, "triggered_event_name", String.class, null);
            cVar.triggeredEventParams = (Bundle) c2.q(bundle, "triggered_event_params", Bundle.class, null);
            ((Long) c2.q(bundle, "time_to_live", Long.class, 0L)).longValue();
            cVar.expiredEventName = (String) c2.q(bundle, "expired_event_name", String.class, null);
            cVar.expiredEventParams = (Bundle) c2.q(bundle, "expired_event_params", Bundle.class, null);
            ((Boolean) c2.q(bundle, "active", Boolean.class, Boolean.FALSE)).booleanValue();
            ((Long) c2.q(bundle, "creation_timestamp", Long.class, 0L)).longValue();
            ((Long) c2.q(bundle, "triggered_timestamp", Long.class, 0L)).longValue();
            arrayList.add(cVar);
        }
        return arrayList;
    }

    @Override // wa.d
    public final void logEvent(String str, String str2, Bundle bundle) {
        if (bundle == null) {
            bundle = new Bundle();
        }
        if ((!xa.a.f34754c.contains(str)) && xa.a.a(bundle, str2) && xa.a.b(str, str2, bundle)) {
            if ("clx".equals(str) && "_ae".equals(str2)) {
                bundle.putLong("_r", 1L);
            }
            this.f34257a.logEvent(str, str2, bundle);
        }
    }

    @Override // wa.d
    public final a registerAnalyticsConnectorListener(String str, b bVar) {
        Object tVar;
        w.checkNotNull(null);
        if (!(!xa.a.f34754c.contains(str))) {
            return null;
        }
        boolean zIsEmpty = str.isEmpty();
        ConcurrentHashMap concurrentHashMap = this.f34258b;
        if (!zIsEmpty && concurrentHashMap.containsKey(str) && concurrentHashMap.get(str) != null) {
            return null;
        }
        boolean zEquals = "fiam".equals(str);
        s8.a aVar = this.f34257a;
        if (zEquals) {
            u.e eVar = new u.e();
            eVar.f33126b = null;
            eVar.f33127c = aVar;
            xa.b bVar2 = new xa.b(eVar, 0);
            eVar.f33128d = bVar2;
            aVar.a(bVar2);
            eVar.f33125a = new HashSet();
            tVar = eVar;
        } else {
            tVar = "clx".equals(str) ? new t(aVar) : null;
        }
        if (tVar == null) {
            return null;
        }
        concurrentHashMap.put(str, tVar);
        return new f(this, str, 16);
    }
}
