package F3;

import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.RandomAccess;
import java.util.Set;

/* JADX INFO: renamed from: F3.b, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes3.dex */
public abstract class AbstractC0199b extends AbstractC0217q implements e0, Serializable {

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final transient Map f1535e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public transient int f1536f;

    public AbstractC0199b(Map map) {
        A4.g.k(map.isEmpty());
        this.f1535e = map;
    }

    @Override // F3.j0
    public final Collection a() {
        Collection collection = this.f1589a;
        if (collection != null) {
            return collection;
        }
        C0216p c0216p = new C0216p(this, 0);
        this.f1589a = c0216p;
        return c0216p;
    }

    @Override // F3.j0
    public final Map b() {
        Map map = this.f1592d;
        if (map != null) {
            return map;
        }
        Map mapF = f();
        this.f1592d = mapF;
        return mapF;
    }

    public final void e() {
        Map map = this.f1535e;
        Iterator it = map.values().iterator();
        while (it.hasNext()) {
            ((Collection) it.next()).clear();
        }
        map.clear();
        this.f1536f = 0;
    }

    public Map f() {
        return new C0206f(this, this.f1535e);
    }

    public abstract Collection g();

    public Set h() {
        return new C0207g(this, this.f1535e);
    }

    @Override // F3.j0
    public final boolean put(Object obj, Object obj2) {
        Map map = this.f1535e;
        Collection collection = (Collection) map.get(obj);
        if (collection != null) {
            if (!collection.add(obj2)) {
                return false;
            }
            this.f1536f++;
            return true;
        }
        Collection collectionG = g();
        if (!collectionG.add(obj2)) {
            throw new AssertionError("New Collection violated the Collection spec");
        }
        this.f1536f++;
        map.put(obj, collectionG);
        return true;
    }

    @Override // F3.j0
    public final int size() {
        return this.f1536f;
    }

    @Override // F3.j0
    public final Collection values() {
        Collection collection = this.f1591c;
        if (collection != null) {
            return collection;
        }
        C0216p c0216p = new C0216p(this, 1);
        this.f1591c = c0216p;
        return c0216p;
    }

    @Override // F3.j0
    public final List get(Object obj) {
        Collection collectionG = (Collection) this.f1535e.get(obj);
        if (collectionG == null) {
            collectionG = g();
        }
        List list = (List) collectionG;
        return list instanceof RandomAccess ? new C0210j(this, obj, list, null) : new C0214n(this, obj, list, null);
    }
}
