package lh;

import java.io.File;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import lh.h;
import ph.n;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes4.dex */
public final class g {

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

    /* renamed from: b, reason: collision with root package name */
    private final List f28124b = new ArrayList();

    /* renamed from: c, reason: collision with root package name */
    private com.bumptech.glide.d f28125c;

    /* renamed from: d, reason: collision with root package name */
    private Object f28126d;

    /* renamed from: e, reason: collision with root package name */
    private int f28127e;

    /* renamed from: f, reason: collision with root package name */
    private int f28128f;

    /* renamed from: g, reason: collision with root package name */
    private Class f28129g;

    /* renamed from: h, reason: collision with root package name */
    private h.e f28130h;

    /* renamed from: i, reason: collision with root package name */
    private jh.h f28131i;

    /* renamed from: j, reason: collision with root package name */
    private Map f28132j;

    /* renamed from: k, reason: collision with root package name */
    private Class f28133k;

    /* renamed from: l, reason: collision with root package name */
    private boolean f28134l;

    /* renamed from: m, reason: collision with root package name */
    private boolean f28135m;

    /* renamed from: n, reason: collision with root package name */
    private jh.f f28136n;

    /* renamed from: o, reason: collision with root package name */
    private com.bumptech.glide.g f28137o;

    /* renamed from: p, reason: collision with root package name */
    private j f28138p;

    /* renamed from: q, reason: collision with root package name */
    private boolean f28139q;

    /* renamed from: r, reason: collision with root package name */
    private boolean f28140r;

    /* JADX INFO: Access modifiers changed from: package-private */
    public void a() {
        this.f28125c = null;
        this.f28126d = null;
        this.f28136n = null;
        this.f28129g = null;
        this.f28133k = null;
        this.f28131i = null;
        this.f28137o = null;
        this.f28132j = null;
        this.f28138p = null;
        this.f28123a.clear();
        this.f28134l = false;
        this.f28124b.clear();
        this.f28135m = false;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public mh.b b() {
        return this.f28125c.b();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public List c() {
        if (!this.f28135m) {
            this.f28135m = true;
            this.f28124b.clear();
            List g10 = g();
            int size = g10.size();
            for (int i10 = 0; i10 < size; i10++) {
                n.a aVar = (n.a) g10.get(i10);
                if (!this.f28124b.contains(aVar.f32706a)) {
                    this.f28124b.add(aVar.f32706a);
                }
                for (int i11 = 0; i11 < aVar.f32707b.size(); i11++) {
                    if (!this.f28124b.contains(aVar.f32707b.get(i11))) {
                        this.f28124b.add(aVar.f32707b.get(i11));
                    }
                }
            }
        }
        return this.f28124b;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public nh.a d() {
        return this.f28130h.a();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public j e() {
        return this.f28138p;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public int f() {
        return this.f28128f;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public List g() {
        if (!this.f28134l) {
            this.f28134l = true;
            this.f28123a.clear();
            List i10 = this.f28125c.i().i(this.f28126d);
            int size = i10.size();
            for (int i11 = 0; i11 < size; i11++) {
                n.a b10 = ((ph.n) i10.get(i11)).b(this.f28126d, this.f28127e, this.f28128f, this.f28131i);
                if (b10 != null) {
                    this.f28123a.add(b10);
                }
            }
        }
        return this.f28123a;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public t h(Class cls) {
        return this.f28125c.i().h(cls, this.f28129g, this.f28133k);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public Class i() {
        return this.f28126d.getClass();
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public List j(File file) {
        return this.f28125c.i().i(file);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public jh.h k() {
        return this.f28131i;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public com.bumptech.glide.g l() {
        return this.f28137o;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public List m() {
        return this.f28125c.i().j(this.f28126d.getClass(), this.f28129g, this.f28133k);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public jh.k n(v vVar) {
        return this.f28125c.i().k(vVar);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public com.bumptech.glide.load.data.e o(Object obj) {
        return this.f28125c.i().l(obj);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public jh.f p() {
        return this.f28136n;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public jh.d q(Object obj) {
        return this.f28125c.i().m(obj);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public Class r() {
        return this.f28133k;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public jh.l s(Class cls) {
        jh.l lVar = (jh.l) this.f28132j.get(cls);
        if (lVar == null) {
            Iterator it = this.f28132j.entrySet().iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                Map.Entry entry = (Map.Entry) it.next();
                if (((Class) entry.getKey()).isAssignableFrom(cls)) {
                    lVar = (jh.l) entry.getValue();
                    break;
                }
            }
        }
        if (lVar != null) {
            return lVar;
        }
        if (!this.f28132j.isEmpty() || !this.f28139q) {
            return rh.c.c();
        }
        throw new IllegalArgumentException("Missing transformation for " + cls + ". If you wish to ignore unknown resource types, use the optional transformation methods.");
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public int t() {
        return this.f28127e;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public boolean u(Class cls) {
        return h(cls) != null;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void v(com.bumptech.glide.d dVar, Object obj, jh.f fVar, int i10, int i11, j jVar, Class cls, Class cls2, com.bumptech.glide.g gVar, jh.h hVar, Map map, boolean z10, boolean z11, h.e eVar) {
        this.f28125c = dVar;
        this.f28126d = obj;
        this.f28136n = fVar;
        this.f28127e = i10;
        this.f28128f = i11;
        this.f28138p = jVar;
        this.f28129g = cls;
        this.f28130h = eVar;
        this.f28133k = cls2;
        this.f28137o = gVar;
        this.f28131i = hVar;
        this.f28132j = map;
        this.f28139q = z10;
        this.f28140r = z11;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public boolean w(v vVar) {
        return this.f28125c.i().n(vVar);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public boolean x() {
        return this.f28140r;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public boolean y(jh.f fVar) {
        List g10 = g();
        int size = g10.size();
        for (int i10 = 0; i10 < size; i10++) {
            if (((n.a) g10.get(i10)).f32706a.equals(fVar)) {
                return true;
            }
        }
        return false;
    }
}
