package com.applovin.impl; import com.applovin.impl.we; import com.applovin.impl.xe; import java.util.HashMap; import java.util.Map; /* loaded from: classes.dex */ public final class ye { private static final HashMap b = new HashMap(); private static final HashMap c = new HashMap(); private static final HashMap d = new HashMap(); private final com.applovin.impl.sdk.j a; /* JADX INFO: Access modifiers changed from: private */ public static /* synthetic */ Long a(Long l, Long l2) { return l; } public ye(com.applovin.impl.sdk.j jVar) { this.a = jVar; } private void b(we weVar, xe xeVar, we.a aVar) { HashMap hashMap; if (a(weVar, xeVar, aVar)) { String b2 = xeVar.b(); HashMap a = a(xeVar.a()); synchronized (a) { try { if (a.containsKey(b2)) { hashMap = (HashMap) a.get(b2); } else { HashMap hashMap2 = new HashMap(); a.put(b2, hashMap2); hashMap = hashMap2; } hashMap.put(weVar, aVar.a(hashMap.get(weVar))); } catch (Throwable th) { throw th; } } } } private boolean a(we weVar, xe xeVar, we.a aVar) { if (weVar == null) { this.a.J(); if (com.applovin.impl.sdk.n.a()) { this.a.J().b("MediationStatsManager", "Failed to update stat, no stat provided"); } return false; } if (xeVar == null) { this.a.J(); if (com.applovin.impl.sdk.n.a()) { this.a.J().b("MediationStatsManager", "Failed to update stat, no dimension key provided"); } return false; } if (aVar != null) { return true; } this.a.J(); if (com.applovin.impl.sdk.n.a()) { this.a.J().b("MediationStatsManager", "Failed to update stat, no stat updater provided"); } return false; } public Map a(we weVar, xe.a aVar) { HashMap a = a(aVar); HashMap hashMap = new HashMap(); synchronized (a) { try { for (String str : a.keySet()) { hashMap.put(str, ((HashMap) a.get(str)).get(weVar)); } } catch (Throwable th) { throw th; } } return hashMap; } private HashMap a(xe.a aVar) { return aVar == xe.a.AD_UNIT_ID ? b : aVar == xe.a.AD_FORMAT ? c : d; } public void a(we weVar, xe xeVar) { b(weVar, xeVar, new we.a() { // from class: com.applovin.impl.ye$$ExternalSyntheticLambda1 @Override // com.applovin.impl.we.a public final Object a(Object obj) { Long a; a = ye.a((Long) obj); return a; } }); } /* JADX INFO: Access modifiers changed from: private */ public static /* synthetic */ Long a(Long l) { return Long.valueOf(l != null ? 1 + l.longValue() : 1L); } public void a(we weVar, xe xeVar, final Long l) { b(weVar, xeVar, new we.a() { // from class: com.applovin.impl.ye$$ExternalSyntheticLambda0 @Override // com.applovin.impl.we.a public final Object a(Object obj) { Long a; a = ye.a(l, (Long) obj); return a; } }); } }