package u5;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.TimeInterpolator;
import android.graphics.Path;
import android.graphics.Rect;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import androidx.core.view.s0;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/* loaded from: classes.dex */
public abstract class n implements Cloneable {
    private static final int[] V = {2, 1, 3, 4};
    private static final g W = new a();
    private static ThreadLocal X = new ThreadLocal();
    private ArrayList I;
    private ArrayList J;
    q R;
    private e S;
    private androidx.collection.a T;

    /* renamed from: p, reason: collision with root package name */
    private String f36900p = getClass().getName();

    /* renamed from: q, reason: collision with root package name */
    private long f36901q = -1;

    /* renamed from: r, reason: collision with root package name */
    long f36902r = -1;

    /* renamed from: s, reason: collision with root package name */
    private TimeInterpolator f36903s = null;

    /* renamed from: t, reason: collision with root package name */
    ArrayList f36904t = new ArrayList();

    /* renamed from: u, reason: collision with root package name */
    ArrayList f36905u = new ArrayList();

    /* renamed from: v, reason: collision with root package name */
    private ArrayList f36906v = null;

    /* renamed from: w, reason: collision with root package name */
    private ArrayList f36907w = null;

    /* renamed from: x, reason: collision with root package name */
    private ArrayList f36908x = null;

    /* renamed from: y, reason: collision with root package name */
    private ArrayList f36909y = null;

    /* renamed from: z, reason: collision with root package name */
    private ArrayList f36910z = null;
    private ArrayList A = null;
    private ArrayList B = null;
    private ArrayList C = null;
    private ArrayList D = null;
    private u E = new u();
    private u F = new u();
    r G = null;
    private int[] H = V;
    boolean K = false;
    ArrayList L = new ArrayList();
    private int M = 0;
    private boolean N = false;
    private boolean O = false;
    private ArrayList P = null;
    private ArrayList Q = new ArrayList();
    private g U = W;

    /* loaded from: classes.dex */
    class a extends g {
        a() {
        }

        @Override // u5.g
        public Path a(float f10, float f11, float f12, float f13) {
            Path path = new Path();
            path.moveTo(f10, f11);
            path.lineTo(f12, f13);
            return path;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public class b extends AnimatorListenerAdapter {

        /* renamed from: a, reason: collision with root package name */
        final /* synthetic */ androidx.collection.a f36911a;

        b(androidx.collection.a aVar) {
            this.f36911a = aVar;
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            this.f36911a.remove(animator);
            n.this.L.remove(animator);
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationStart(Animator animator) {
            n.this.L.add(animator);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public class c extends AnimatorListenerAdapter {
        c() {
        }

        @Override // android.animation.AnimatorListenerAdapter, android.animation.Animator.AnimatorListener
        public void onAnimationEnd(Animator animator) {
            n.this.s();
            animator.removeListener(this);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes.dex */
    public static class d {

        /* renamed from: a, reason: collision with root package name */
        View f36914a;

        /* renamed from: b, reason: collision with root package name */
        String f36915b;

        /* renamed from: c, reason: collision with root package name */
        t f36916c;

        /* renamed from: d, reason: collision with root package name */
        l0 f36917d;

        /* renamed from: e, reason: collision with root package name */
        n f36918e;

        d(View view, String str, n nVar, l0 l0Var, t tVar) {
            this.f36914a = view;
            this.f36915b = str;
            this.f36916c = tVar;
            this.f36917d = l0Var;
            this.f36918e = nVar;
        }
    }

    /* loaded from: classes.dex */
    public static abstract class e {
        public abstract Rect a(n nVar);
    }

    /* loaded from: classes.dex */
    public interface f {
        void a(n nVar);

        void b(n nVar);

        void c(n nVar);

        void d(n nVar);

        void e(n nVar);
    }

    private static androidx.collection.a B() {
        androidx.collection.a aVar = (androidx.collection.a) X.get();
        if (aVar != null) {
            return aVar;
        }
        androidx.collection.a aVar2 = new androidx.collection.a();
        X.set(aVar2);
        return aVar2;
    }

    private static boolean N(t tVar, t tVar2, String str) {
        Object obj = tVar.f36935a.get(str);
        Object obj2 = tVar2.f36935a.get(str);
        if (obj == null && obj2 == null) {
            return false;
        }
        if (obj == null || obj2 == null) {
            return true;
        }
        return !obj.equals(obj2);
    }

    private void O(androidx.collection.a aVar, androidx.collection.a aVar2, SparseArray sparseArray, SparseArray sparseArray2) {
        View view;
        int size = sparseArray.size();
        for (int i10 = 0; i10 < size; i10++) {
            View view2 = (View) sparseArray.valueAt(i10);
            if (view2 != null && M(view2) && (view = (View) sparseArray2.get(sparseArray.keyAt(i10))) != null && M(view)) {
                t tVar = (t) aVar.get(view2);
                t tVar2 = (t) aVar2.get(view);
                if (tVar != null && tVar2 != null) {
                    this.I.add(tVar);
                    this.J.add(tVar2);
                    aVar.remove(view2);
                    aVar2.remove(view);
                }
            }
        }
    }

    private void P(androidx.collection.a aVar, androidx.collection.a aVar2) {
        t tVar;
        for (int size = aVar.size() - 1; size >= 0; size--) {
            View view = (View) aVar.f(size);
            if (view != null && M(view) && (tVar = (t) aVar2.remove(view)) != null && M(tVar.f36936b)) {
                this.I.add((t) aVar.h(size));
                this.J.add(tVar);
            }
        }
    }

    private void R(androidx.collection.a aVar, androidx.collection.a aVar2, androidx.collection.s sVar, androidx.collection.s sVar2) {
        View view;
        int n10 = sVar.n();
        for (int i10 = 0; i10 < n10; i10++) {
            View view2 = (View) sVar.o(i10);
            if (view2 != null && M(view2) && (view = (View) sVar2.d(sVar.i(i10))) != null && M(view)) {
                t tVar = (t) aVar.get(view2);
                t tVar2 = (t) aVar2.get(view);
                if (tVar != null && tVar2 != null) {
                    this.I.add(tVar);
                    this.J.add(tVar2);
                    aVar.remove(view2);
                    aVar2.remove(view);
                }
            }
        }
    }

    private void S(androidx.collection.a aVar, androidx.collection.a aVar2, androidx.collection.a aVar3, androidx.collection.a aVar4) {
        View view;
        int size = aVar3.size();
        for (int i10 = 0; i10 < size; i10++) {
            View view2 = (View) aVar3.m(i10);
            if (view2 != null && M(view2) && (view = (View) aVar4.get(aVar3.f(i10))) != null && M(view)) {
                t tVar = (t) aVar.get(view2);
                t tVar2 = (t) aVar2.get(view);
                if (tVar != null && tVar2 != null) {
                    this.I.add(tVar);
                    this.J.add(tVar2);
                    aVar.remove(view2);
                    aVar2.remove(view);
                }
            }
        }
    }

    private void T(u uVar, u uVar2) {
        androidx.collection.a aVar = new androidx.collection.a(uVar.f36938a);
        androidx.collection.a aVar2 = new androidx.collection.a(uVar2.f36938a);
        int i10 = 0;
        while (true) {
            int[] iArr = this.H;
            if (i10 >= iArr.length) {
                c(aVar, aVar2);
                return;
            }
            int i11 = iArr[i10];
            if (i11 == 1) {
                P(aVar, aVar2);
            } else if (i11 == 2) {
                S(aVar, aVar2, uVar.f36941d, uVar2.f36941d);
            } else if (i11 == 3) {
                O(aVar, aVar2, uVar.f36939b, uVar2.f36939b);
            } else if (i11 == 4) {
                R(aVar, aVar2, uVar.f36940c, uVar2.f36940c);
            }
            i10++;
        }
    }

    private void Z(Animator animator, androidx.collection.a aVar) {
        if (animator != null) {
            animator.addListener(new b(aVar));
            f(animator);
        }
    }

    private void c(androidx.collection.a aVar, androidx.collection.a aVar2) {
        for (int i10 = 0; i10 < aVar.size(); i10++) {
            t tVar = (t) aVar.m(i10);
            if (M(tVar.f36936b)) {
                this.I.add(tVar);
                this.J.add(null);
            }
        }
        for (int i11 = 0; i11 < aVar2.size(); i11++) {
            t tVar2 = (t) aVar2.m(i11);
            if (M(tVar2.f36936b)) {
                this.J.add(tVar2);
                this.I.add(null);
            }
        }
    }

    private static void d(u uVar, View view, t tVar) {
        uVar.f36938a.put(view, tVar);
        int id2 = view.getId();
        if (id2 >= 0) {
            if (uVar.f36939b.indexOfKey(id2) >= 0) {
                uVar.f36939b.put(id2, null);
            } else {
                uVar.f36939b.put(id2, view);
            }
        }
        String H = s0.H(view);
        if (H != null) {
            if (uVar.f36941d.containsKey(H)) {
                uVar.f36941d.put(H, null);
            } else {
                uVar.f36941d.put(H, view);
            }
        }
        if (view.getParent() instanceof ListView) {
            ListView listView = (ListView) view.getParent();
            if (listView.getAdapter().hasStableIds()) {
                long itemIdAtPosition = listView.getItemIdAtPosition(listView.getPositionForView(view));
                if (uVar.f36940c.f(itemIdAtPosition) < 0) {
                    s0.w0(view, true);
                    uVar.f36940c.j(itemIdAtPosition, view);
                    return;
                }
                View view2 = (View) uVar.f36940c.d(itemIdAtPosition);
                if (view2 != null) {
                    s0.w0(view2, false);
                    uVar.f36940c.j(itemIdAtPosition, null);
                }
            }
        }
    }

    private void i(View view, boolean z10) {
        if (view == null) {
            return;
        }
        int id2 = view.getId();
        ArrayList arrayList = this.f36908x;
        if (arrayList == null || !arrayList.contains(Integer.valueOf(id2))) {
            ArrayList arrayList2 = this.f36909y;
            if (arrayList2 == null || !arrayList2.contains(view)) {
                ArrayList arrayList3 = this.f36910z;
                if (arrayList3 != null) {
                    int size = arrayList3.size();
                    for (int i10 = 0; i10 < size; i10++) {
                        if (((Class) this.f36910z.get(i10)).isInstance(view)) {
                            return;
                        }
                    }
                }
                if (view.getParent() instanceof ViewGroup) {
                    t tVar = new t(view);
                    if (z10) {
                        k(tVar);
                    } else {
                        h(tVar);
                    }
                    tVar.f36937c.add(this);
                    j(tVar);
                    if (z10) {
                        d(this.E, view, tVar);
                    } else {
                        d(this.F, view, tVar);
                    }
                }
                if (view instanceof ViewGroup) {
                    ArrayList arrayList4 = this.B;
                    if (arrayList4 == null || !arrayList4.contains(Integer.valueOf(id2))) {
                        ArrayList arrayList5 = this.C;
                        if (arrayList5 == null || !arrayList5.contains(view)) {
                            ArrayList arrayList6 = this.D;
                            if (arrayList6 != null) {
                                int size2 = arrayList6.size();
                                for (int i11 = 0; i11 < size2; i11++) {
                                    if (((Class) this.D.get(i11)).isInstance(view)) {
                                        return;
                                    }
                                }
                            }
                            ViewGroup viewGroup = (ViewGroup) view;
                            for (int i12 = 0; i12 < viewGroup.getChildCount(); i12++) {
                                i(viewGroup.getChildAt(i12), z10);
                            }
                        }
                    }
                }
            }
        }
    }

    public q A() {
        return this.R;
    }

    public long C() {
        return this.f36901q;
    }

    public List D() {
        return this.f36904t;
    }

    public List E() {
        return this.f36906v;
    }

    public List F() {
        return this.f36907w;
    }

    public List G() {
        return this.f36905u;
    }

    public String[] H() {
        return null;
    }

    public t K(View view, boolean z10) {
        r rVar = this.G;
        if (rVar != null) {
            return rVar.K(view, z10);
        }
        return (t) (z10 ? this.E : this.F).f36938a.get(view);
    }

    public boolean L(t tVar, t tVar2) {
        if (tVar == null || tVar2 == null) {
            return false;
        }
        String[] H = H();
        if (H == null) {
            Iterator it = tVar.f36935a.keySet().iterator();
            while (it.hasNext()) {
                if (N(tVar, tVar2, (String) it.next())) {
                }
            }
            return false;
        }
        for (String str : H) {
            if (!N(tVar, tVar2, str)) {
            }
        }
        return false;
        return true;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public boolean M(View view) {
        ArrayList arrayList;
        ArrayList arrayList2;
        int id2 = view.getId();
        ArrayList arrayList3 = this.f36908x;
        if (arrayList3 != null && arrayList3.contains(Integer.valueOf(id2))) {
            return false;
        }
        ArrayList arrayList4 = this.f36909y;
        if (arrayList4 != null && arrayList4.contains(view)) {
            return false;
        }
        ArrayList arrayList5 = this.f36910z;
        if (arrayList5 != null) {
            int size = arrayList5.size();
            for (int i10 = 0; i10 < size; i10++) {
                if (((Class) this.f36910z.get(i10)).isInstance(view)) {
                    return false;
                }
            }
        }
        if (this.A != null && s0.H(view) != null && this.A.contains(s0.H(view))) {
            return false;
        }
        if ((this.f36904t.size() == 0 && this.f36905u.size() == 0 && (((arrayList = this.f36907w) == null || arrayList.isEmpty()) && ((arrayList2 = this.f36906v) == null || arrayList2.isEmpty()))) || this.f36904t.contains(Integer.valueOf(id2)) || this.f36905u.contains(view)) {
            return true;
        }
        ArrayList arrayList6 = this.f36906v;
        if (arrayList6 != null && arrayList6.contains(s0.H(view))) {
            return true;
        }
        if (this.f36907w != null) {
            for (int i11 = 0; i11 < this.f36907w.size(); i11++) {
                if (((Class) this.f36907w.get(i11)).isInstance(view)) {
                    return true;
                }
            }
        }
        return false;
    }

    public void U(View view) {
        if (this.O) {
            return;
        }
        for (int size = this.L.size() - 1; size >= 0; size--) {
            u5.a.b((Animator) this.L.get(size));
        }
        ArrayList arrayList = this.P;
        if (arrayList != null && arrayList.size() > 0) {
            ArrayList arrayList2 = (ArrayList) this.P.clone();
            int size2 = arrayList2.size();
            for (int i10 = 0; i10 < size2; i10++) {
                ((f) arrayList2.get(i10)).b(this);
            }
        }
        this.N = true;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void V(ViewGroup viewGroup) {
        d dVar;
        this.I = new ArrayList();
        this.J = new ArrayList();
        T(this.E, this.F);
        androidx.collection.a B = B();
        int size = B.size();
        l0 d10 = b0.d(viewGroup);
        for (int i10 = size - 1; i10 >= 0; i10--) {
            Animator animator = (Animator) B.f(i10);
            if (animator != null && (dVar = (d) B.get(animator)) != null && dVar.f36914a != null && d10.equals(dVar.f36917d)) {
                t tVar = dVar.f36916c;
                View view = dVar.f36914a;
                t K = K(view, true);
                t x10 = x(view, true);
                if (K == null && x10 == null) {
                    x10 = (t) this.F.f36938a.get(view);
                }
                if (!(K == null && x10 == null) && dVar.f36918e.L(tVar, x10)) {
                    if (animator.isRunning() || animator.isStarted()) {
                        animator.cancel();
                    } else {
                        B.remove(animator);
                    }
                }
            }
        }
        q(viewGroup, this.E, this.F, this.I, this.J);
        a0();
    }

    public n W(f fVar) {
        ArrayList arrayList = this.P;
        if (arrayList == null) {
            return this;
        }
        arrayList.remove(fVar);
        if (this.P.size() == 0) {
            this.P = null;
        }
        return this;
    }

    public n X(View view) {
        this.f36905u.remove(view);
        return this;
    }

    public void Y(View view) {
        if (this.N) {
            if (!this.O) {
                for (int size = this.L.size() - 1; size >= 0; size--) {
                    u5.a.c((Animator) this.L.get(size));
                }
                ArrayList arrayList = this.P;
                if (arrayList != null && arrayList.size() > 0) {
                    ArrayList arrayList2 = (ArrayList) this.P.clone();
                    int size2 = arrayList2.size();
                    for (int i10 = 0; i10 < size2; i10++) {
                        ((f) arrayList2.get(i10)).e(this);
                    }
                }
            }
            this.N = false;
        }
    }

    public n a(f fVar) {
        if (this.P == null) {
            this.P = new ArrayList();
        }
        this.P.add(fVar);
        return this;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public void a0() {
        i0();
        androidx.collection.a B = B();
        Iterator it = this.Q.iterator();
        while (it.hasNext()) {
            Animator animator = (Animator) it.next();
            if (B.containsKey(animator)) {
                i0();
                Z(animator, B);
            }
        }
        this.Q.clear();
        s();
    }

    public n b(View view) {
        this.f36905u.add(view);
        return this;
    }

    public n b0(long j10) {
        this.f36902r = j10;
        return this;
    }

    public void c0(e eVar) {
        this.S = eVar;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public void cancel() {
        for (int size = this.L.size() - 1; size >= 0; size--) {
            ((Animator) this.L.get(size)).cancel();
        }
        ArrayList arrayList = this.P;
        if (arrayList == null || arrayList.size() <= 0) {
            return;
        }
        ArrayList arrayList2 = (ArrayList) this.P.clone();
        int size2 = arrayList2.size();
        for (int i10 = 0; i10 < size2; i10++) {
            ((f) arrayList2.get(i10)).a(this);
        }
    }

    public n d0(TimeInterpolator timeInterpolator) {
        this.f36903s = timeInterpolator;
        return this;
    }

    protected void f(Animator animator) {
        if (animator == null) {
            s();
            return;
        }
        if (t() >= 0) {
            animator.setDuration(t());
        }
        if (C() >= 0) {
            animator.setStartDelay(C() + animator.getStartDelay());
        }
        if (w() != null) {
            animator.setInterpolator(w());
        }
        animator.addListener(new c());
        animator.start();
    }

    public void f0(g gVar) {
        if (gVar == null) {
            this.U = W;
        } else {
            this.U = gVar;
        }
    }

    public void g0(q qVar) {
        this.R = qVar;
    }

    public abstract void h(t tVar);

    public n h0(long j10) {
        this.f36901q = j10;
        return this;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public void i0() {
        if (this.M == 0) {
            ArrayList arrayList = this.P;
            if (arrayList != null && arrayList.size() > 0) {
                ArrayList arrayList2 = (ArrayList) this.P.clone();
                int size = arrayList2.size();
                for (int i10 = 0; i10 < size; i10++) {
                    ((f) arrayList2.get(i10)).d(this);
                }
            }
            this.O = false;
        }
        this.M++;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void j(t tVar) {
        String[] b10;
        if (this.R == null || tVar.f36935a.isEmpty() || (b10 = this.R.b()) == null) {
            return;
        }
        boolean z10 = false;
        int i10 = 0;
        while (true) {
            if (i10 >= b10.length) {
                z10 = true;
                break;
            } else if (!tVar.f36935a.containsKey(b10[i10])) {
                break;
            } else {
                i10++;
            }
        }
        if (z10) {
            return;
        }
        this.R.a(tVar);
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public String j0(String str) {
        String str2 = str + getClass().getSimpleName() + "@" + Integer.toHexString(hashCode()) + ": ";
        if (this.f36902r != -1) {
            str2 = str2 + "dur(" + this.f36902r + ") ";
        }
        if (this.f36901q != -1) {
            str2 = str2 + "dly(" + this.f36901q + ") ";
        }
        if (this.f36903s != null) {
            str2 = str2 + "interp(" + this.f36903s + ") ";
        }
        if (this.f36904t.size() <= 0 && this.f36905u.size() <= 0) {
            return str2;
        }
        String str3 = str2 + "tgts(";
        if (this.f36904t.size() > 0) {
            for (int i10 = 0; i10 < this.f36904t.size(); i10++) {
                if (i10 > 0) {
                    str3 = str3 + ", ";
                }
                str3 = str3 + this.f36904t.get(i10);
            }
        }
        if (this.f36905u.size() > 0) {
            for (int i11 = 0; i11 < this.f36905u.size(); i11++) {
                if (i11 > 0) {
                    str3 = str3 + ", ";
                }
                str3 = str3 + this.f36905u.get(i11);
            }
        }
        return str3 + ")";
    }

    public abstract void k(t tVar);

    /* JADX INFO: Access modifiers changed from: package-private */
    public void l(ViewGroup viewGroup, boolean z10) {
        ArrayList arrayList;
        ArrayList arrayList2;
        androidx.collection.a aVar;
        n(z10);
        if ((this.f36904t.size() > 0 || this.f36905u.size() > 0) && (((arrayList = this.f36906v) == null || arrayList.isEmpty()) && ((arrayList2 = this.f36907w) == null || arrayList2.isEmpty()))) {
            for (int i10 = 0; i10 < this.f36904t.size(); i10++) {
                View findViewById = viewGroup.findViewById(((Integer) this.f36904t.get(i10)).intValue());
                if (findViewById != null) {
                    t tVar = new t(findViewById);
                    if (z10) {
                        k(tVar);
                    } else {
                        h(tVar);
                    }
                    tVar.f36937c.add(this);
                    j(tVar);
                    if (z10) {
                        d(this.E, findViewById, tVar);
                    } else {
                        d(this.F, findViewById, tVar);
                    }
                }
            }
            for (int i11 = 0; i11 < this.f36905u.size(); i11++) {
                View view = (View) this.f36905u.get(i11);
                t tVar2 = new t(view);
                if (z10) {
                    k(tVar2);
                } else {
                    h(tVar2);
                }
                tVar2.f36937c.add(this);
                j(tVar2);
                if (z10) {
                    d(this.E, view, tVar2);
                } else {
                    d(this.F, view, tVar2);
                }
            }
        } else {
            i(viewGroup, z10);
        }
        if (z10 || (aVar = this.T) == null) {
            return;
        }
        int size = aVar.size();
        ArrayList arrayList3 = new ArrayList(size);
        for (int i12 = 0; i12 < size; i12++) {
            arrayList3.add(this.E.f36941d.remove((String) this.T.f(i12)));
        }
        for (int i13 = 0; i13 < size; i13++) {
            View view2 = (View) arrayList3.get(i13);
            if (view2 != null) {
                this.E.f36941d.put((String) this.T.m(i13), view2);
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public void n(boolean z10) {
        if (z10) {
            this.E.f36938a.clear();
            this.E.f36939b.clear();
            this.E.f36940c.a();
        } else {
            this.F.f36938a.clear();
            this.F.f36939b.clear();
            this.F.f36940c.a();
        }
    }

    @Override // 
    /* renamed from: o, reason: merged with bridge method [inline-methods] */
    public n clone() {
        try {
            n nVar = (n) super.clone();
            nVar.Q = new ArrayList();
            nVar.E = new u();
            nVar.F = new u();
            nVar.I = null;
            nVar.J = null;
            return nVar;
        } catch (CloneNotSupportedException unused) {
            return null;
        }
    }

    public Animator p(ViewGroup viewGroup, t tVar, t tVar2) {
        return null;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public void q(ViewGroup viewGroup, u uVar, u uVar2, ArrayList arrayList, ArrayList arrayList2) {
        Animator p10;
        int i10;
        View view;
        Animator animator;
        t tVar;
        Animator animator2;
        t tVar2;
        androidx.collection.a B = B();
        SparseIntArray sparseIntArray = new SparseIntArray();
        int size = arrayList.size();
        long j10 = Long.MAX_VALUE;
        int i11 = 0;
        while (i11 < size) {
            t tVar3 = (t) arrayList.get(i11);
            t tVar4 = (t) arrayList2.get(i11);
            if (tVar3 != null && !tVar3.f36937c.contains(this)) {
                tVar3 = null;
            }
            if (tVar4 != null && !tVar4.f36937c.contains(this)) {
                tVar4 = null;
            }
            if (tVar3 != null || tVar4 != null) {
                if ((tVar3 == null || tVar4 == null || L(tVar3, tVar4)) && (p10 = p(viewGroup, tVar3, tVar4)) != null) {
                    if (tVar4 != null) {
                        view = tVar4.f36936b;
                        String[] H = H();
                        if (H != null && H.length > 0) {
                            tVar2 = new t(view);
                            i10 = size;
                            t tVar5 = (t) uVar2.f36938a.get(view);
                            if (tVar5 != null) {
                                int i12 = 0;
                                while (i12 < H.length) {
                                    Map map = tVar2.f36935a;
                                    String str = H[i12];
                                    map.put(str, tVar5.f36935a.get(str));
                                    i12++;
                                    H = H;
                                }
                            }
                            int size2 = B.size();
                            int i13 = 0;
                            while (true) {
                                if (i13 >= size2) {
                                    animator2 = p10;
                                    break;
                                }
                                d dVar = (d) B.get((Animator) B.f(i13));
                                if (dVar.f36916c != null && dVar.f36914a == view && dVar.f36915b.equals(y()) && dVar.f36916c.equals(tVar2)) {
                                    animator2 = null;
                                    break;
                                }
                                i13++;
                            }
                        } else {
                            i10 = size;
                            animator2 = p10;
                            tVar2 = null;
                        }
                        animator = animator2;
                        tVar = tVar2;
                    } else {
                        i10 = size;
                        view = tVar3.f36936b;
                        animator = p10;
                        tVar = null;
                    }
                    if (animator != null) {
                        q qVar = this.R;
                        if (qVar != null) {
                            long c10 = qVar.c(viewGroup, this, tVar3, tVar4);
                            sparseIntArray.put(this.Q.size(), (int) c10);
                            j10 = Math.min(c10, j10);
                        }
                        B.put(animator, new d(view, y(), this, b0.d(viewGroup), tVar));
                        this.Q.add(animator);
                        j10 = j10;
                    }
                    i11++;
                    size = i10;
                }
            }
            i10 = size;
            i11++;
            size = i10;
        }
        if (sparseIntArray.size() != 0) {
            for (int i14 = 0; i14 < sparseIntArray.size(); i14++) {
                Animator animator3 = (Animator) this.Q.get(sparseIntArray.keyAt(i14));
                animator3.setStartDelay((sparseIntArray.valueAt(i14) - j10) + animator3.getStartDelay());
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: protected */
    public void s() {
        int i10 = this.M - 1;
        this.M = i10;
        if (i10 == 0) {
            ArrayList arrayList = this.P;
            if (arrayList != null && arrayList.size() > 0) {
                ArrayList arrayList2 = (ArrayList) this.P.clone();
                int size = arrayList2.size();
                for (int i11 = 0; i11 < size; i11++) {
                    ((f) arrayList2.get(i11)).c(this);
                }
            }
            for (int i12 = 0; i12 < this.E.f36940c.n(); i12++) {
                View view = (View) this.E.f36940c.o(i12);
                if (view != null) {
                    s0.w0(view, false);
                }
            }
            for (int i13 = 0; i13 < this.F.f36940c.n(); i13++) {
                View view2 = (View) this.F.f36940c.o(i13);
                if (view2 != null) {
                    s0.w0(view2, false);
                }
            }
            this.O = true;
        }
    }

    public long t() {
        return this.f36902r;
    }

    public String toString() {
        return j0("");
    }

    public Rect u() {
        e eVar = this.S;
        if (eVar == null) {
            return null;
        }
        return eVar.a(this);
    }

    public e v() {
        return this.S;
    }

    public TimeInterpolator w() {
        return this.f36903s;
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    public t x(View view, boolean z10) {
        r rVar = this.G;
        if (rVar != null) {
            return rVar.x(view, z10);
        }
        ArrayList arrayList = z10 ? this.I : this.J;
        if (arrayList == null) {
            return null;
        }
        int size = arrayList.size();
        int i10 = 0;
        while (true) {
            if (i10 >= size) {
                i10 = -1;
                break;
            }
            t tVar = (t) arrayList.get(i10);
            if (tVar == null) {
                return null;
            }
            if (tVar.f36936b == view) {
                break;
            }
            i10++;
        }
        if (i10 >= 0) {
            return (t) (z10 ? this.J : this.I).get(i10);
        }
        return null;
    }

    public String y() {
        return this.f36900p;
    }

    public g z() {
        return this.U;
    }
}
