package m2;

import android.content.res.Configuration;
import android.content.res.Resources;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import kotlin.jvm.internal.t;

/* loaded from: classes.dex */
public final class d {

    /* renamed from: a, reason: collision with root package name */
    private final HashMap f28576a = new HashMap();

    /* loaded from: classes.dex */
    public static final class a {

        /* renamed from: a, reason: collision with root package name */
        private final x1.d f28577a;

        /* renamed from: b, reason: collision with root package name */
        private final int f28578b;

        public a(x1.d dVar, int i10) {
            this.f28577a = dVar;
            this.f28578b = i10;
        }

        public final int a() {
            return this.f28578b;
        }

        public final x1.d b() {
            return this.f28577a;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof a)) {
                return false;
            }
            a aVar = (a) obj;
            return t.b(this.f28577a, aVar.f28577a) && this.f28578b == aVar.f28578b;
        }

        public int hashCode() {
            return (this.f28577a.hashCode() * 31) + Integer.hashCode(this.f28578b);
        }

        public String toString() {
            return "ImageVectorEntry(imageVector=" + this.f28577a + ", configFlags=" + this.f28578b + ')';
        }
    }

    /* loaded from: classes.dex */
    public static final class b {

        /* renamed from: a, reason: collision with root package name */
        private final Resources.Theme f28579a;

        /* renamed from: b, reason: collision with root package name */
        private final int f28580b;

        public b(Resources.Theme theme, int i10) {
            this.f28579a = theme;
            this.f28580b = i10;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof b)) {
                return false;
            }
            b bVar = (b) obj;
            return t.b(this.f28579a, bVar.f28579a) && this.f28580b == bVar.f28580b;
        }

        public int hashCode() {
            return (this.f28579a.hashCode() * 31) + Integer.hashCode(this.f28580b);
        }

        public String toString() {
            return "Key(theme=" + this.f28579a + ", id=" + this.f28580b + ')';
        }
    }

    public final void a() {
        this.f28576a.clear();
    }

    public final a b(b bVar) {
        WeakReference weakReference = (WeakReference) this.f28576a.get(bVar);
        if (weakReference != null) {
            return (a) weakReference.get();
        }
        return null;
    }

    public final void c(int i10) {
        Iterator it = this.f28576a.entrySet().iterator();
        while (it.hasNext()) {
            a aVar = (a) ((WeakReference) ((Map.Entry) it.next()).getValue()).get();
            if (aVar == null || Configuration.needNewResources(i10, aVar.a())) {
                it.remove();
            }
        }
    }

    public final void d(b bVar, a aVar) {
        this.f28576a.put(bVar, new WeakReference(aVar));
    }
}
