package com.bumptech.glide; import com.bumptech.glide.load.ImageHeaderParser; import com.bumptech.glide.load.data.e; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Iterator; import java.util.List; import s1.t; import s1.v; import w1.n; import w1.o; /* loaded from: classes.dex */ public class i { /* renamed from: a, reason: collision with root package name */ private final o f4159a; /* renamed from: b, reason: collision with root package name */ private final h2.a f4160b; /* renamed from: c, reason: collision with root package name */ private final h2.e f4161c; /* renamed from: d, reason: collision with root package name */ private final h2.f f4162d; /* renamed from: e, reason: collision with root package name */ private final com.bumptech.glide.load.data.f f4163e; /* renamed from: f, reason: collision with root package name */ private final e2.f f4164f; /* renamed from: g, reason: collision with root package name */ private final h2.b f4165g; /* renamed from: h, reason: collision with root package name */ private final h2.d f4166h = new h2.d(); /* renamed from: i, reason: collision with root package name */ private final h2.c f4167i = new h2.c(); /* renamed from: j, reason: collision with root package name */ private final y.e f4168j; public static class a extends RuntimeException { public a(String str) { super(str); } } public static final class b extends a { public b() { super("Failed to find image header parser."); } } public static class c extends a { public c(Object obj) { super("Failed to find any ModelLoaders registered for model class: " + obj.getClass()); } public c(Object obj, List list) { super("Found ModelLoaders for model class: " + list + ", but none that handle this specific model instance: " + obj); } public c(Class cls, Class cls2) { super("Failed to find any ModelLoaders for model: " + cls + " and data: " + cls2); } } public static class d extends a { public d(Class cls) { super("Failed to find result encoder for resource class: " + cls + ", you may need to consider registering a new Encoder for the requested type or DiskCacheStrategy.DATA/DiskCacheStrategy.NONE if caching your transformed resource is unnecessary."); } } public static class e extends a { public e(Class cls) { super("Failed to find source encoder for data class: " + cls); } } public i() { y.e e10 = n2.a.e(); this.f4168j = e10; this.f4159a = new o(e10); this.f4160b = new h2.a(); this.f4161c = new h2.e(); this.f4162d = new h2.f(); this.f4163e = new com.bumptech.glide.load.data.f(); this.f4164f = new e2.f(); this.f4165g = new h2.b(); r(Arrays.asList("Gif", "Bitmap", "BitmapDrawable")); } private List f(Class cls, Class cls2, Class cls3) { ArrayList arrayList = new ArrayList(); for (Class cls4 : this.f4161c.d(cls, cls2)) { for (Class cls5 : this.f4164f.b(cls4, cls3)) { arrayList.add(new s1.i(cls, cls4, cls5, this.f4161c.b(cls, cls4), this.f4164f.a(cls4, cls5), this.f4168j)); } } return arrayList; } public i a(Class cls, Class cls2, q1.j jVar) { e("legacy_append", cls, cls2, jVar); return this; } public i b(Class cls, Class cls2, n nVar) { this.f4159a.a(cls, cls2, nVar); return this; } public i c(Class cls, q1.d dVar) { this.f4160b.a(cls, dVar); return this; } public i d(Class cls, q1.k kVar) { this.f4162d.a(cls, kVar); return this; } public i e(String str, Class cls, Class cls2, q1.j jVar) { this.f4161c.a(str, jVar, cls, cls2); return this; } public List g() { List b10 = this.f4165g.b(); if (b10.isEmpty()) { throw new b(); } return b10; } public t h(Class cls, Class cls2, Class cls3) { t a10 = this.f4167i.a(cls, cls2, cls3); if (this.f4167i.c(a10)) { return null; } if (a10 == null) { List f10 = f(cls, cls2, cls3); a10 = f10.isEmpty() ? null : new t(cls, cls2, cls3, f10, this.f4168j); this.f4167i.d(cls, cls2, cls3, a10); } return a10; } public List i(Object obj) { return this.f4159a.d(obj); } public List j(Class cls, Class cls2, Class cls3) { List a10 = this.f4166h.a(cls, cls2, cls3); if (a10 == null) { a10 = new ArrayList(); Iterator it = this.f4159a.c(cls).iterator(); while (it.hasNext()) { for (Class cls4 : this.f4161c.d((Class) it.next(), cls2)) { if (!this.f4164f.b(cls4, cls3).isEmpty() && !a10.contains(cls4)) { a10.add(cls4); } } } this.f4166h.b(cls, cls2, cls3, Collections.unmodifiableList(a10)); } return a10; } public q1.k k(v vVar) { q1.k b10 = this.f4162d.b(vVar.d()); if (b10 != null) { return b10; } throw new d(vVar.d()); } public com.bumptech.glide.load.data.e l(Object obj) { return this.f4163e.a(obj); } public q1.d m(Object obj) { q1.d b10 = this.f4160b.b(obj.getClass()); if (b10 != null) { return b10; } throw new e(obj.getClass()); } public boolean n(v vVar) { return this.f4162d.b(vVar.d()) != null; } public i o(ImageHeaderParser imageHeaderParser) { this.f4165g.a(imageHeaderParser); return this; } public i p(e.a aVar) { this.f4163e.b(aVar); return this; } public i q(Class cls, Class cls2, e2.e eVar) { this.f4164f.c(cls, cls2, eVar); return this; } public final i r(List list) { ArrayList arrayList = new ArrayList(list.size()); arrayList.add("legacy_prepend_all"); Iterator it = list.iterator(); while (it.hasNext()) { arrayList.add((String) it.next()); } arrayList.add("legacy_append"); this.f4161c.e(arrayList); return this; } }