package y5; import android.os.Handler; import android.webkit.WebView; import androidx.appcompat.app.m; import java.util.Iterator; import java.util.Map; import java.util.concurrent.TimeUnit; import org.json.JSONObject; import t5.i; import u5.e; import w5.d; /* loaded from: classes2.dex */ public class c extends y5.a { /* renamed from: d, reason: collision with root package name */ private WebView f15638d; /* renamed from: e, reason: collision with root package name */ private Long f15639e = null; /* renamed from: f, reason: collision with root package name */ private final Map f15640f; /* renamed from: g, reason: collision with root package name */ private final String f15641g; class a implements Runnable { /* renamed from: a, reason: collision with root package name */ private final WebView f15642a; a() { this.f15642a = c.this.f15638d; } @Override // java.lang.Runnable public void run() { this.f15642a.destroy(); } } public c(Map map, String str) { this.f15640f = map; this.f15641g = str; } @Override // y5.a public void a() { super.a(); p(); } @Override // y5.a public void f(i iVar, t5.c cVar) { JSONObject jSONObject = new JSONObject(); Map e10 = cVar.e(); for (String str : e10.keySet()) { m.a(e10.get(str)); w5.b.f(jSONObject, str, null); } g(iVar, cVar, jSONObject); } @Override // y5.a public void i() { super.i(); new Handler().postDelayed(new a(), Math.max(4000 - (this.f15639e == null ? 4000L : TimeUnit.MILLISECONDS.convert(d.a() - this.f15639e.longValue(), TimeUnit.NANOSECONDS)), 2000L)); this.f15638d = null; } void p() { WebView webView = new WebView(u5.d.a().c()); this.f15638d = webView; webView.getSettings().setJavaScriptEnabled(true); c(this.f15638d); e.a().i(this.f15638d, this.f15641g); Iterator it = this.f15640f.keySet().iterator(); if (!it.hasNext()) { this.f15639e = Long.valueOf(d.a()); } else { m.a(this.f15640f.get((String) it.next())); throw null; } } }