package com.google.android.gms.internal.gtm; import java.util.Iterator; import java.util.List; import java.util.Map; /* JADX INFO: Add missing generic type declarations: [V, K] */ /* loaded from: classes2.dex */ final class zztk implements Iterator> { private int pos; private Iterator> zzbee; private final zztc zzbef; private boolean zzbej; private zztk(zztc zztcVar) { this.zzbef = zztcVar; this.pos = -1; } @Override // java.util.Iterator public final boolean hasNext() { List list; Map map; int i = this.pos + 1; list = this.zzbef.zzbdz; if (i >= list.size()) { map = this.zzbef.zzbea; if (map.isEmpty() || !zzrf().hasNext()) { return false; } } return true; } @Override // java.util.Iterator public final void remove() { List list; if (!this.zzbej) { throw new IllegalStateException("remove() was called before next()"); } this.zzbej = false; this.zzbef.zzrd(); int i = this.pos; list = this.zzbef.zzbdz; if (i >= list.size()) { zzrf().remove(); return; } zztc zztcVar = this.zzbef; int i2 = this.pos; this.pos = i2 - 1; zztcVar.zzbw(i2); } private final Iterator> zzrf() { Map map; if (this.zzbee == null) { map = this.zzbef.zzbea; this.zzbee = map.entrySet().iterator(); } return this.zzbee; } @Override // java.util.Iterator public final /* synthetic */ Object next() { List list; List list2; this.zzbej = true; int i = this.pos + 1; this.pos = i; list = this.zzbef.zzbdz; if (i >= list.size()) { return zzrf().next(); } list2 = this.zzbef.zzbdz; return (Map.Entry) list2.get(this.pos); } /* JADX INFO: Access modifiers changed from: package-private */ public /* synthetic */ zztk(zztc zztcVar, zztd zztdVar) { this(zztcVar); } }