package com.ironsource; import com.ironsource.wd; import java.util.LinkedHashMap; import java.util.Map; import kotlin.Result; import kotlin.ResultKt; import kotlin.Unit; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.SourceDebugExtension; @SourceDebugExtension({"SMAP\nShowCountHandler.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ShowCountHandler.kt\ncom/ironsource/services/capping/showcount/ShowCountHandler\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n*L\n1#1,82:1\n1#2:83\n*E\n"}) /* loaded from: classes2.dex */ public final class cs implements wd, wd.a { private final k9 a; private final og b; private final Map c; public static final class a { private int a; private long b; private Long c; public a(int i, long j, Long l) { this.a = i; this.b = j; this.c = l; } public static /* synthetic */ a a(a aVar, int i, long j, Long l, int i2, Object obj) { if ((i2 & 1) != 0) { i = aVar.a; } if ((i2 & 2) != 0) { j = aVar.b; } if ((i2 & 4) != 0) { l = aVar.c; } return aVar.a(i, j, l); } public final int a() { return this.a; } public final a a(int i, long j, Long l) { return new a(i, j, l); } public final void a(int i) { this.a = i; } public final void a(long j) { this.b = j; } public final void a(Long l) { this.c = l; } public final long b() { return this.b; } public final Long c() { return this.c; } public final int d() { return this.a; } public final long e() { return this.b; } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof a)) { return false; } a aVar = (a) obj; return this.a == aVar.a && this.b == aVar.b && Intrinsics.areEqual(this.c, aVar.c); } public final Long f() { return this.c; } public int hashCode() { int hashCode = ((Integer.hashCode(this.a) * 31) + Long.hashCode(this.b)) * 31; Long l = this.c; return hashCode + (l == null ? 0 : l.hashCode()); } public String toString() { return "ShowCountCappingInfo(currentNumberOfShows=" + this.a + ", currentTime=" + this.b + ", currentTimeThreshold=" + this.c + ')'; } } public cs(k9 currentTimeProvider, og serviceDataRepository) { Intrinsics.checkNotNullParameter(currentTimeProvider, "currentTimeProvider"); Intrinsics.checkNotNullParameter(serviceDataRepository, "serviceDataRepository"); this.a = currentTimeProvider; this.b = serviceDataRepository; this.c = new LinkedHashMap(); } private final boolean a(zr zrVar, String str) { a c = c(str); Long f = c.f(); if (f != null) { return c.d() >= zrVar.a() && this.a.a() < f.longValue(); } return false; } private final a c(String str) { return new a(this.b.a(str), this.a.a(), this.b.b(str)); } @Override // com.ironsource.wd public f8 a(String identifier) { Intrinsics.checkNotNullParameter(identifier, "identifier"); zr zrVar = this.c.get(identifier); if (zrVar != null && a(zrVar, identifier)) { return new f8(true, h8.ShowCount); } return new f8(false, null, 2, null); } @Override // com.ironsource.wd.a public Object a(String identifier, h8 cappingType, ud cappingConfig) { Object createFailure; Intrinsics.checkNotNullParameter(identifier, "identifier"); Intrinsics.checkNotNullParameter(cappingType, "cappingType"); Intrinsics.checkNotNullParameter(cappingConfig, "cappingConfig"); Object c = cappingConfig.c(); if (Result.m4065isSuccessimpl(c)) { zr zrVar = (zr) c; if (zrVar != null) { this.c.put(identifier, zrVar); } } else { Throwable m4062exceptionOrNullimpl = Result.m4062exceptionOrNullimpl(c); if (m4062exceptionOrNullimpl != null) { createFailure = ResultKt.createFailure(m4062exceptionOrNullimpl); return Result.m4060constructorimpl(createFailure); } } createFailure = Unit.INSTANCE; return Result.m4060constructorimpl(createFailure); } public final Map a() { return this.c; } /* JADX WARN: Code restructure failed: missing block: B:11:0x002e, code lost: if (r4 >= (r2 != null ? r2.longValue() : 0)) goto L13; */ @Override // com.ironsource.wd.a /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public void b(java.lang.String r9) { /* r8 = this; java.lang.String r0 = "identifier" kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r9, r0) java.util.Map r0 = r8.c java.lang.Object r0 = r0.get(r9) com.ironsource.zr r0 = (com.ironsource.zr) r0 if (r0 != 0) goto L10 return L10: com.ironsource.cs$a r1 = r8.c(r9) int r2 = r1.d() r3 = 1 if (r2 == 0) goto L30 long r4 = r1.e() java.lang.Long r2 = r1.f() if (r2 == 0) goto L2a long r6 = r2.longValue() goto L2c L2a: r6 = 0 L2c: int r2 = (r4 > r6 ? 1 : (r4 == r6 ? 0 : -1)) if (r2 < 0) goto L47 L30: long r4 = r1.e() com.ironsource.g8 r0 = r0.b() r2 = 0 long r6 = com.ironsource.g8.a(r0, r2, r3, r2) long r4 = r4 + r6 com.ironsource.og r0 = r8.b r0.a(r4, r9) r0 = 0 r1.a(r0) L47: int r0 = r1.d() int r0 = r0 + r3 r1.a(r0) com.ironsource.og r0 = r8.b int r1 = r1.d() r0.a(r1, r9) return */ throw new UnsupportedOperationException("Method not decompiled: com.ironsource.cs.b(java.lang.String):void"); } }