package z0; import c1.p; import java.util.ArrayList; import java.util.Iterator; import java.util.List; /* loaded from: classes.dex */ public abstract class c implements y0.a { /* renamed from: a, reason: collision with root package name */ private final List f15705a = new ArrayList(); /* renamed from: b, reason: collision with root package name */ private Object f15706b; /* renamed from: c, reason: collision with root package name */ private a1.d f15707c; /* renamed from: d, reason: collision with root package name */ private a f15708d; public interface a { void a(List list); void b(List list); } c(a1.d dVar) { this.f15707c = dVar; } private void h(a aVar, Object obj) { if (this.f15705a.isEmpty() || aVar == null) { return; } if (obj == null || c(obj)) { aVar.b(this.f15705a); } else { aVar.a(this.f15705a); } } @Override // y0.a public void a(Object obj) { this.f15706b = obj; h(this.f15708d, obj); } abstract boolean b(p pVar); abstract boolean c(Object obj); public boolean d(String str) { Object obj = this.f15706b; return obj != null && c(obj) && this.f15705a.contains(str); } public void e(Iterable iterable) { this.f15705a.clear(); Iterator it = iterable.iterator(); while (it.hasNext()) { p pVar = (p) it.next(); if (b(pVar)) { this.f15705a.add(pVar.f3397a); } } if (this.f15705a.isEmpty()) { this.f15707c.c(this); } else { this.f15707c.a(this); } h(this.f15708d, this.f15706b); } public void f() { if (this.f15705a.isEmpty()) { return; } this.f15705a.clear(); this.f15707c.c(this); } public void g(a aVar) { if (this.f15708d != aVar) { this.f15708d = aVar; h(aVar, this.f15706b); } } }