package y5; import android.webkit.WebView; import androidx.appcompat.app.m; import java.util.Iterator; import org.json.JSONArray; import org.json.JSONObject; import t5.i; import u5.d; import u5.e; /* loaded from: classes2.dex */ public abstract class a { /* renamed from: a, reason: collision with root package name */ private x5.b f15631a; /* renamed from: b, reason: collision with root package name */ private EnumC0267a f15632b; /* renamed from: c, reason: collision with root package name */ private long f15633c; /* renamed from: y5.a$a, reason: collision with other inner class name */ enum EnumC0267a { AD_STATE_IDLE, AD_STATE_VISIBLE, AD_STATE_NOTVISIBLE } public a() { n(); this.f15631a = new x5.b(null); } public void a() { } public void b(float f10) { e.a().c(m(), f10); } void c(WebView webView) { this.f15631a = new x5.b(webView); } public void d(String str, long j10) { if (j10 >= this.f15633c) { this.f15632b = EnumC0267a.AD_STATE_VISIBLE; e.a().j(m(), str); } } public void e(t5.b bVar) { e.a().g(m(), bVar.b()); } public void f(i iVar, t5.c cVar) { g(iVar, cVar, null); } protected void g(i iVar, t5.c cVar, JSONObject jSONObject) { String j10 = iVar.j(); JSONObject jSONObject2 = new JSONObject(); w5.b.f(jSONObject2, "environment", "app"); w5.b.f(jSONObject2, "adSessionType", cVar.b()); w5.b.f(jSONObject2, "deviceInfo", w5.a.d()); JSONArray jSONArray = new JSONArray(); jSONArray.put("clid"); jSONArray.put("vlid"); w5.b.f(jSONObject2, "supports", jSONArray); JSONObject jSONObject3 = new JSONObject(); w5.b.f(jSONObject3, "partnerName", cVar.g().b()); w5.b.f(jSONObject3, "partnerVersion", cVar.g().c()); w5.b.f(jSONObject2, "omidNativeInfo", jSONObject3); JSONObject jSONObject4 = new JSONObject(); w5.b.f(jSONObject4, "libraryVersion", "1.3.21-Vungle"); w5.b.f(jSONObject4, "appId", d.a().c().getApplicationContext().getPackageName()); w5.b.f(jSONObject2, "app", jSONObject4); if (cVar.c() != null) { w5.b.f(jSONObject2, "contentUrl", cVar.c()); } if (cVar.d() != null) { w5.b.f(jSONObject2, "customReferenceData", cVar.d()); } JSONObject jSONObject5 = new JSONObject(); Iterator it = cVar.h().iterator(); if (it.hasNext()) { m.a(it.next()); throw null; } e.a().d(m(), j10, jSONObject2, jSONObject5, jSONObject); } public void h(boolean z10) { if (k()) { e.a().k(m(), z10 ? "foregrounded" : "backgrounded"); } } public void i() { this.f15631a.clear(); } public void j(String str, long j10) { if (j10 >= this.f15633c) { EnumC0267a enumC0267a = this.f15632b; EnumC0267a enumC0267a2 = EnumC0267a.AD_STATE_NOTVISIBLE; if (enumC0267a != enumC0267a2) { this.f15632b = enumC0267a2; e.a().j(m(), str); } } } public boolean k() { return this.f15631a.get() != 0; } public void l() { e.a().b(m()); } /* JADX WARN: Multi-variable type inference failed */ public WebView m() { return (WebView) this.f15631a.get(); } public void n() { this.f15633c = w5.d.a(); this.f15632b = EnumC0267a.AD_STATE_IDLE; } }