package o; import android.content.Context; import android.graphics.Bitmap; import android.graphics.drawable.Drawable; import android.net.Uri; import android.widget.ImageView; import com.bumptech.glide.Glide; import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.concurrent.Executor; /* loaded from: classes.dex */ public final class Cdw extends AbstractC11268ecD> implements Cloneable { private List> A; private Object B; private final YSJ C; private boolean D; private CqY E; private Float G; private final Class H; private Cdw I; private boolean u = true; private final Glide v; private final Context w; private Cdw x; private final Fqf y; private boolean z; static { new PNS().a(LHy.d).d(EnumC3495ayd.LOW).p(); } /* JADX INFO: Access modifiers changed from: protected */ public Cdw(Glide glide, YSJ ysj, Class cls, Context context) { this.v = glide; this.C = ysj; this.H = cls; this.w = context; Fqf fqf = ysj.d.c; CqY cqY = fqf.a.get(cls); if (cqY == null) { for (Map.Entry, CqY> entry : fqf.a.entrySet()) { if (entry.getKey().isAssignableFrom(cls)) { cqY = (CqY) entry.getValue(); } } } this.E = cqY == null ? Fqf.b : cqY; this.y = glide.c; Iterator> it = ysj.c.iterator(); while (it.hasNext()) { a((InterfaceC6871cdb) it.next()); } PNS e = ysj.e(); if (e != null) { return; } throw new NullPointerException("Argument must not be null"); } public final Cdw b(AbstractC11268ecD abstractC11268ecD) { if (abstractC11268ecD != null) { return (Cdw) super.d(abstractC11268ecD); } throw new NullPointerException("Argument must not be null"); } public final Cdw d(InterfaceC6871cdb interfaceC6871cdb) { Cdw cdw = this; while (cdw.j()) { cdw = cdw.clone(); } cdw.A = null; return cdw.a((InterfaceC6871cdb) interfaceC6871cdb); } private Cdw a(InterfaceC6871cdb interfaceC6871cdb) { Cdw cdw = this; while (cdw.j()) { cdw = cdw.clone(); } if (interfaceC6871cdb != null) { if (cdw.A == null) { cdw.A = new ArrayList(); } cdw.A.add(interfaceC6871cdb); } if (cdw.j) { throw new IllegalStateException("You cannot modify locked T, consider clone()"); } return cdw; } public final Cdw c(Object obj) { return a(obj); } private Cdw a(Object obj) { Cdw cdw = this; while (cdw.j()) { cdw = cdw.clone(); } cdw.B = obj; cdw.D = true; if (cdw.j) { throw new IllegalStateException("You cannot modify locked T, consider clone()"); } return cdw; } public final Cdw Dr_(Bitmap bitmap) { Cdw a = a(bitmap); PNS a2 = new PNS().a(LHy.e); if (a2 != null) { return (Cdw) super.d(a2); } throw new NullPointerException("Argument must not be null"); } public final Cdw Ds_(Drawable drawable) { Cdw a = a(drawable); PNS a2 = new PNS().a(LHy.e); if (a2 != null) { return (Cdw) super.d(a2); } throw new NullPointerException("Argument must not be null"); } public final Cdw a(String str) { return a((Object) str); } public final Cdw Dt_(Uri uri) { return a(uri); } public final Cdw a(File file) { return a((Object) file); } public final Cdw a(Integer num) { Cdw a = a((Object) num); PNS c = new PNS().c(vjG.d(this.w)); if (c == null) { throw new NullPointerException("Argument must not be null"); } return (Cdw) super.d(c); } public final Cdw e(byte[] bArr) { Cdw a = a(bArr); if (!a.f()) { PNS a2 = new PNS().a(LHy.e); if (a2 == null) { throw new NullPointerException("Argument must not be null"); } a = (Cdw) super.d(a2); } if (a.n()) { return a; } if (PNS.x == null) { PNS.x = new PNS().p().c(); } PNS pns = PNS.x; if (pns == null) { throw new NullPointerException("Argument must not be null"); } return (Cdw) super.d(pns); } /* JADX INFO: Access modifiers changed from: private */ @Override // o.AbstractC11268ecD /* renamed from: s, reason: merged with bridge method [inline-methods] and merged with bridge method [inline-methods] */ public Cdw d() { Cdw cdw = (Cdw) super.d(); cdw.E = (CqY) cdw.E.clone(); if (cdw.A != null) { cdw.A = new ArrayList(cdw.A); } Cdw cdw2 = cdw.I; if (cdw2 != null) { cdw.I = cdw2.clone(); } Cdw cdw3 = cdw.x; if (cdw3 != null) { cdw.x = cdw3.clone(); } return cdw; } /* JADX WARN: Removed duplicated region for block: B:14:0x0061 */ /* JADX WARN: Removed duplicated region for block: B:18:0x0067 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final o.TOD Dq_(android.widget.ImageView r4) { /* r3 = this; o.FKd.d() if (r4 == 0) goto L99 boolean r0 = r3.o() if (r0 != 0) goto L52 boolean r0 = r3.l() if (r0 == 0) goto L52 android.widget.ImageView$ScaleType r0 = r4.getScaleType() if (r0 == 0) goto L52 int[] r0 = o.Cdw.AnonymousClass3.a android.widget.ImageView$ScaleType r1 = r4.getScaleType() int r1 = r1.ordinal() r0 = r0[r1] switch(r0) { case 1: goto L42; case 2: goto L39; case 3: goto L30; case 4: goto L30; case 5: goto L30; case 6: goto L27; default: goto L26; } L26: goto L52 L27: o.ecD r0 = r3.d() o.ecD r0 = r0.t() goto L53 L30: o.ecD r0 = r3.d() o.ecD r0 = r0.r() goto L53 L39: o.ecD r0 = r3.d() o.ecD r0 = r0.t() goto L53 L42: o.ecD r0 = r3.d() o.RBw r1 = o.RBw.e o.Xsc r2 = new o.Xsc r2.() o.ecD r0 = r0.d(r1, r2) goto L53 L52: r0 = r3 L53: o.Fqf r1 = r3.y java.lang.Class r2 = r3.H o.KwM r1 = r1.g java.lang.Class r1 = android.graphics.Bitmap.class boolean r1 = r1.equals(r2) if (r1 == 0) goto L67 o.GQD r1 = new o.GQD r1.(r4) goto L74 L67: java.lang.Class r1 = android.graphics.drawable.Drawable.class boolean r1 = r1.isAssignableFrom(r2) if (r1 == 0) goto L80 o.ksj r1 = new o.ksj r1.(r4) L74: java.util.concurrent.Executor r4 = o.C3107arK.d() r2 = 0 o.YcZ r4 = r3.a(r1, r2, r0, r4) o.TOD r4 = (o.TOD) r4 return r4 L80: java.lang.IllegalArgumentException r4 = new java.lang.IllegalArgumentException java.lang.StringBuilder r0 = new java.lang.StringBuilder java.lang.String r1 = "Unhandled class: " r0.(r1) r0.append(r2) java.lang.String r1 = ", try .as*(Class).transcode(ResourceTranscoder)" r0.append(r1) java.lang.String r0 = r0.toString() r4.(r0) throw r4 L99: java.lang.NullPointerException r4 = new java.lang.NullPointerException java.lang.String r0 = "Argument must not be null" r4.(r0) throw r4 */ throw new UnsupportedOperationException("Method not decompiled: o.Cdw.Dq_(android.widget.ImageView):o.TOD"); } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.Cdw$3, reason: invalid class name */ /* loaded from: classes.dex */ public static /* synthetic */ class AnonymousClass3 { static final int[] a; static final int[] d; static { int[] iArr = new int[EnumC3495ayd.values().length]; d = iArr; try { iArr[EnumC3495ayd.LOW.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { d[EnumC3495ayd.NORMAL.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { d[EnumC3495ayd.HIGH.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { d[EnumC3495ayd.IMMEDIATE.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } int[] iArr2 = new int[ImageView.ScaleType.values().length]; a = iArr2; try { iArr2[ImageView.ScaleType.CENTER_CROP.ordinal()] = 1; } catch (NoSuchFieldError unused5) { } try { a[ImageView.ScaleType.CENTER_INSIDE.ordinal()] = 2; } catch (NoSuchFieldError unused6) { } try { a[ImageView.ScaleType.FIT_CENTER.ordinal()] = 3; } catch (NoSuchFieldError unused7) { } try { a[ImageView.ScaleType.FIT_START.ordinal()] = 4; } catch (NoSuchFieldError unused8) { } try { a[ImageView.ScaleType.FIT_END.ordinal()] = 5; } catch (NoSuchFieldError unused9) { } try { a[ImageView.ScaleType.FIT_XY.ordinal()] = 6; } catch (NoSuchFieldError unused10) { } try { a[ImageView.ScaleType.CENTER.ordinal()] = 7; } catch (NoSuchFieldError unused11) { } try { a[ImageView.ScaleType.MATRIX.ordinal()] = 8; } catch (NoSuchFieldError unused12) { } } } /* JADX WARN: Multi-variable type inference failed */ private PXc b(Object obj, YcZ ycZ, InterfaceC6871cdb interfaceC6871cdb, VZJ vzj, CqY cqY, EnumC3495ayd enumC3495ayd, int i, int i2, AbstractC11268ecD abstractC11268ecD, Executor executor) { lJi lji; VZJ vzj2; PXc a; EnumC3495ayd enumC3495ayd2; if (this.x != null) { vzj2 = new lJi(obj, vzj); lji = vzj2; } else { lji = 0; vzj2 = vzj; } Cdw cdw = this.I; if (cdw == null) { a = a(obj, ycZ, interfaceC6871cdb, abstractC11268ecD, vzj2, cqY, enumC3495ayd, i, i2, executor); } else { if (this.z) { throw new IllegalStateException("You cannot use a request as both the main request and a thumbnail, consider using clone() on the request(s) passed to thumbnail()"); } CqY cqY2 = cdw.u ? cqY : cdw.E; if (cdw.k()) { enumC3495ayd2 = this.I.i(); } else { int i3 = AnonymousClass3.d[enumC3495ayd.ordinal()]; if (i3 == 1) { enumC3495ayd2 = EnumC3495ayd.NORMAL; } else if (i3 == 2) { enumC3495ayd2 = EnumC3495ayd.HIGH; } else if (i3 == 3 || i3 == 4) { enumC3495ayd2 = EnumC3495ayd.IMMEDIATE; } else { StringBuilder sb = new StringBuilder("unknown priority: "); sb.append(i()); throw new IllegalArgumentException(sb.toString()); } } EnumC3495ayd enumC3495ayd3 = enumC3495ayd2; int h = this.I.h(); int g = this.I.g(); if (FKd.c(i, i2) && !this.I.m()) { h = abstractC11268ecD.h(); g = abstractC11268ecD.g(); } xEe xee = new xEe(obj, vzj2); PXc a2 = a(obj, ycZ, interfaceC6871cdb, abstractC11268ecD, xee, cqY, enumC3495ayd, i, i2, executor); this.z = true; Cdw cdw2 = this.I; PXc b = cdw2.b(obj, ycZ, interfaceC6871cdb, xee, cqY2, enumC3495ayd3, h, g, cdw2, executor); this.z = false; xee.d = a2; xee.b = b; a = xee; } if (lji == 0) { return a; } int h2 = this.x.h(); int g2 = this.x.g(); if (FKd.c(i, i2) && !this.x.m()) { h2 = abstractC11268ecD.h(); g2 = abstractC11268ecD.g(); } Cdw cdw3 = this.x; PXc b2 = cdw3.b(obj, ycZ, interfaceC6871cdb, lji, cdw3.E, cdw3.i(), h2, g2, this.x, executor); lji.d = a; lji.e = b2; return lji; } @Override // o.AbstractC11268ecD public final boolean equals(Object obj) { if (!(obj instanceof Cdw)) { return false; } Cdw cdw = (Cdw) obj; if (!super.equals(cdw) || !Objects.equals(this.H, cdw.H) || !this.E.equals(cdw.E) || !Objects.equals(this.B, cdw.B) || !Objects.equals(this.A, cdw.A) || !Objects.equals(this.I, cdw.I) || !Objects.equals(this.x, cdw.x)) { return false; } Float f = cdw.G; return this.u == cdw.u && this.D == cdw.D; } @Override // o.AbstractC11268ecD public final int hashCode() { return FKd.c(this.D, FKd.c(this.u, FKd.e(null, FKd.e(this.x, FKd.e(this.I, FKd.e(this.A, FKd.e(this.B, FKd.e(this.E, FKd.e(this.H, super.hashCode()))))))))); } public final > Y a(Y y, InterfaceC6871cdb interfaceC6871cdb, AbstractC11268ecD abstractC11268ecD, Executor executor) { if (y != null) { if (!this.D) { throw new IllegalArgumentException("You must call #load() before calling #into()"); } PXc b = b(new Object(), y, interfaceC6871cdb, null, this.E, abstractC11268ecD.i(), abstractC11268ecD.h(), abstractC11268ecD.g(), abstractC11268ecD, executor); PXc b2 = y.b(); if (b.b(b2) && (abstractC11268ecD.h || !b2.j())) { if (b2 == null) { throw new NullPointerException("Argument must not be null"); } if (!b2.h()) { b2.a(); } return y; } YSJ ysj = this.C; if (y != null) { ysj.c((YcZ) y); } y.d(b); YSJ ysj2 = this.C; synchronized (ysj2) { ysj2.b.b.add(y); ySr ysr = ysj2.e; ysr.e.add(b); if (!ysr.d) { b.a(); } else { b.c(); ysr.a.add(b); } } return y; } throw new NullPointerException("Argument must not be null"); } private PXc a(Object obj, YcZ ycZ, InterfaceC6871cdb interfaceC6871cdb, AbstractC11268ecD abstractC11268ecD, VZJ vzj, CqY cqY, EnumC3495ayd enumC3495ayd, int i, int i2, Executor executor) { Context context = this.w; Fqf fqf = this.y; return NJQ.b(context, fqf, obj, this.B, this.H, abstractC11268ecD, i, i2, enumC3495ayd, ycZ, interfaceC6871cdb, this.A, vzj, fqf.e, cqY.a, executor); } @Override // o.AbstractC11268ecD public final /* synthetic */ AbstractC11268ecD d(AbstractC11268ecD abstractC11268ecD) { if (abstractC11268ecD != null) { return (Cdw) super.d((AbstractC11268ecD) abstractC11268ecD); } throw new NullPointerException("Argument must not be null"); } public final InterfaceFutureC1911aRr b() { sDD sdd = new sDD(); return (InterfaceFutureC1911aRr) a(sdd, sdd, this, C3107arK.e()); } }