package r3;

import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.TimeInterpolator;
import android.graphics.Rect;
import android.util.SparseArray;
import android.util.SparseIntArray;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowId;
import android.widget.ListView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RestrictTo;
import androidx.core.view.s1;
import com.google.android.material.internal.BaselineLayout;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

/* JADX INFO: loaded from: classes.dex */
public abstract class z implements Cloneable {

    /* JADX INFO: renamed from: g0, reason: collision with root package name */
    public static final Animator[] f32444g0 = new Animator[0];

    /* JADX INFO: renamed from: h0, reason: collision with root package name */
    public static final int[] f32445h0 = {2, 1, 3, 4};

    /* JADX INFO: renamed from: i0, reason: collision with root package name */
    public static final q f32446i0 = new q();

    /* JADX INFO: renamed from: j0, reason: collision with root package name */
    public static final ThreadLocal f32447j0 = new ThreadLocal();
    public ArrayList Q;
    public x[] R;

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    public t f32451b0;

    /* JADX INFO: renamed from: d0, reason: collision with root package name */
    public long f32455d0;

    /* JADX INFO: renamed from: e0, reason: collision with root package name */
    public w f32457e0;

    /* JADX INFO: renamed from: f0, reason: collision with root package name */
    public long f32459f0;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public ArrayList f32466m;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f32448a = getClass().getName();

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public long f32450b = -1;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public long f32452c = -1;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public TimeInterpolator f32454d = null;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final ArrayList f32456e = new ArrayList();

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final ArrayList f32458f = new ArrayList();

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public ArrayList f32460g = null;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public ArrayList f32461h = null;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public u.e f32462i = new u.e(2);

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public u.e f32463j = new u.e(2);

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public h0 f32464k = null;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public int[] f32465l = f32445h0;
    public final boolean S = false;
    public final ArrayList T = new ArrayList();
    public Animator[] U = f32444g0;
    public int V = 0;
    public boolean W = false;
    public boolean X = false;
    public z Y = null;
    public ArrayList Z = null;

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    public ArrayList f32449a0 = new ArrayList();

    /* JADX INFO: renamed from: c0, reason: collision with root package name */
    public n f32453c0 = f32446i0;

    public static void c(u.e eVar, View view, k0 k0Var) {
        ((androidx.collection.f) eVar.f33125a).put(view, k0Var);
        int id2 = view.getId();
        if (id2 >= 0) {
            if (((SparseArray) eVar.f33126b).indexOfKey(id2) >= 0) {
                ((SparseArray) eVar.f33126b).put(id2, null);
            } else {
                ((SparseArray) eVar.f33126b).put(id2, view);
            }
        }
        String transitionName = s1.getTransitionName(view);
        if (transitionName != null) {
            if (((androidx.collection.f) eVar.f33128d).containsKey(transitionName)) {
                ((androidx.collection.f) eVar.f33128d).put(transitionName, null);
            } else {
                ((androidx.collection.f) eVar.f33128d).put(transitionName, view);
            }
        }
        if (view.getParent() instanceof ListView) {
            ListView listView = (ListView) view.getParent();
            if (listView.getAdapter().hasStableIds()) {
                long itemIdAtPosition = listView.getItemIdAtPosition(listView.getPositionForView(view));
                androidx.collection.l lVar = (androidx.collection.l) eVar.f33127c;
                if (lVar.f945a) {
                    int i10 = lVar.f948d;
                    long[] jArr = lVar.f946b;
                    Object[] objArr = lVar.f947c;
                    int i11 = 0;
                    for (int i12 = 0; i12 < i10; i12++) {
                        Object obj = objArr[i12];
                        if (obj != androidx.collection.m.f949a) {
                            if (i12 != i11) {
                                jArr[i11] = jArr[i12];
                                objArr[i11] = obj;
                                objArr[i12] = null;
                            }
                            i11++;
                        }
                    }
                    lVar.f945a = false;
                    lVar.f948d = i11;
                }
                if (t.a.b(lVar.f946b, lVar.f948d, itemIdAtPosition) < 0) {
                    view.setHasTransientState(true);
                    ((androidx.collection.l) eVar.f33127c).e(itemIdAtPosition, view);
                    return;
                }
                View view2 = (View) ((androidx.collection.l) eVar.f33127c).c(itemIdAtPosition);
                if (view2 != null) {
                    view2.setHasTransientState(false);
                    ((androidx.collection.l) eVar.f33127c).e(itemIdAtPosition, null);
                }
            }
        }
    }

    public static androidx.collection.f r() {
        ThreadLocal threadLocal = f32447j0;
        androidx.collection.f fVar = (androidx.collection.f) threadLocal.get();
        if (fVar != null) {
            return fVar;
        }
        androidx.collection.f fVar2 = new androidx.collection.f();
        threadLocal.set(fVar2);
        return fVar2;
    }

    public static boolean v(k0 k0Var, k0 k0Var2, String str) {
        Object obj = k0Var.f32400a.get(str);
        Object obj2 = k0Var2.f32400a.get(str);
        if (obj == null && obj2 == null) {
            return false;
        }
        if (obj == null || obj2 == null) {
            return true;
        }
        return !obj.equals(obj2);
    }

    public void A(View view) {
        this.f32458f.remove(view);
    }

    public void B() {
        F();
        androidx.collection.f fVarR = r();
        for (Animator animator : this.f32449a0) {
            if (fVarR.containsKey(animator)) {
                F();
                if (animator != null) {
                    animator.addListener(new r(this, fVarR, 0));
                    animate(animator);
                }
            }
        }
        this.f32449a0.clear();
        l();
    }

    public void C(long j10, long j11) {
        long j12 = this.f32455d0;
        boolean z10 = j10 < j11;
        if ((j11 < 0 && j10 >= 0) || (j11 > j12 && j10 <= j12)) {
            this.X = false;
            w(this, y.L, z10);
        }
        ArrayList arrayList = this.T;
        int size = arrayList.size();
        Animator[] animatorArr = (Animator[]) arrayList.toArray(this.U);
        this.U = f32444g0;
        for (int i10 = 0; i10 < size; i10++) {
            Animator animator = animatorArr[i10];
            animatorArr[i10] = null;
            u.b(animator, Math.min(Math.max(0L, j10), u.a(animator)));
        }
        this.U = animatorArr;
        if ((j10 <= j12 || j11 > j12) && (j10 >= 0 || j11 < 0)) {
            return;
        }
        if (j10 > j12) {
            this.X = true;
        }
        w(this, y.M, z10);
    }

    public void D(long j10) {
        this.f32452c = j10;
    }

    public void E(long j10) {
        this.f32450b = j10;
    }

    public final void F() {
        if (this.V == 0) {
            x(y.L);
            this.X = false;
        }
        this.V++;
    }

    public String G(String str) {
        StringBuilder sb = new StringBuilder(str);
        sb.append(getClass().getSimpleName());
        sb.append("@");
        sb.append(Integer.toHexString(hashCode()));
        sb.append(": ");
        if (this.f32452c != -1) {
            sb.append("dur(");
            sb.append(this.f32452c);
            sb.append(") ");
        }
        if (this.f32450b != -1) {
            sb.append("dly(");
            sb.append(this.f32450b);
            sb.append(") ");
        }
        if (this.f32454d != null) {
            sb.append("interp(");
            sb.append(this.f32454d);
            sb.append(") ");
        }
        ArrayList arrayList = this.f32456e;
        int size = arrayList.size();
        ArrayList arrayList2 = this.f32458f;
        if (size > 0 || arrayList2.size() > 0) {
            sb.append("tgts(");
            if (arrayList.size() > 0) {
                for (int i10 = 0; i10 < arrayList.size(); i10++) {
                    if (i10 > 0) {
                        sb.append(", ");
                    }
                    sb.append(arrayList.get(i10));
                }
            }
            if (arrayList2.size() > 0) {
                for (int i11 = 0; i11 < arrayList2.size(); i11++) {
                    if (i11 > 0) {
                        sb.append(", ");
                    }
                    sb.append(arrayList2.get(i11));
                }
            }
            sb.append(")");
        }
        return sb.toString();
    }

    public void a(x xVar) {
        if (this.Z == null) {
            this.Z = new ArrayList();
        }
        this.Z.add(xVar);
    }

    @RestrictTo({RestrictTo.Scope.f557c})
    public void animate(@Nullable Animator animator) {
        if (animator == null) {
            l();
            return;
        }
        long j10 = this.f32452c;
        if (j10 >= 0) {
            animator.setDuration(j10);
        }
        long j11 = this.f32450b;
        if (j11 >= 0) {
            animator.setStartDelay(animator.getStartDelay() + j11);
        }
        if (getInterpolator() != null) {
            animator.setInterpolator(getInterpolator());
        }
        animator.addListener(new l.e(this, 1));
        animator.start();
    }

    public void b(View view) {
        this.f32458f.add(view);
    }

    public void cancel() {
        ArrayList arrayList = this.T;
        int size = arrayList.size();
        Animator[] animatorArr = (Animator[]) arrayList.toArray(this.U);
        this.U = f32444g0;
        for (int i10 = size - 1; i10 >= 0; i10--) {
            Animator animator = animatorArr[i10];
            animatorArr[i10] = null;
            animator.cancel();
        }
        this.U = animatorArr;
        w(this, y.N, false);
    }

    @Nullable
    public Animator createAnimator(@NonNull ViewGroup viewGroup, @Nullable k0 k0Var, @Nullable k0 k0Var2) {
        return null;
    }

    public abstract void d(k0 k0Var);

    public final void e(View view, boolean z10) {
        if (view == null) {
            return;
        }
        view.getId();
        ArrayList arrayList = this.f32460g;
        if (arrayList == null || !arrayList.contains(view)) {
            ArrayList arrayList2 = this.f32461h;
            if (arrayList2 != null) {
                int size = arrayList2.size();
                for (int i10 = 0; i10 < size; i10++) {
                    if (((Class) this.f32461h.get(i10)).isInstance(view)) {
                        return;
                    }
                }
            }
            if (view.getParent() instanceof ViewGroup) {
                k0 k0Var = new k0(view);
                if (z10) {
                    g(k0Var);
                } else {
                    d(k0Var);
                }
                k0Var.f32402c.add(this);
                f(k0Var);
                if (z10) {
                    c(this.f32462i, view, k0Var);
                } else {
                    c(this.f32463j, view, k0Var);
                }
            }
            if (view instanceof ViewGroup) {
                ViewGroup viewGroup = (ViewGroup) view;
                for (int i11 = 0; i11 < viewGroup.getChildCount(); i11++) {
                    e(viewGroup.getChildAt(i11), z10);
                }
            }
        }
    }

    public void f(k0 k0Var) {
    }

    @RestrictTo({RestrictTo.Scope.f557c})
    public void forceToEnd(@Nullable ViewGroup viewGroup) {
        androidx.collection.f fVarR = r();
        int i10 = fVarR.f968c;
        if (viewGroup == null || i10 == 0) {
            return;
        }
        WindowId windowId = viewGroup.getWindowId();
        androidx.collection.f fVar = new androidx.collection.f(fVarR);
        fVarR.clear();
        for (int i11 = i10 - 1; i11 >= 0; i11--) {
            s sVar = (s) fVar.m(i11);
            if (sVar.f32415a != null && windowId.equals(sVar.f32418d)) {
                ((Animator) fVar.i(i11)).end();
            }
        }
    }

    public abstract void g(k0 k0Var);

    @Nullable
    public Rect getEpicenter() {
        t tVar = this.f32451b0;
        if (tVar == null) {
            return null;
        }
        return tVar.onGetEpicenter(this);
    }

    @Nullable
    public t getEpicenterCallback() {
        return this.f32451b0;
    }

    @Nullable
    public TimeInterpolator getInterpolator() {
        return this.f32454d;
    }

    @Nullable
    public e0 getPropagation() {
        return null;
    }

    @Nullable
    public List<String> getTargetNames() {
        return null;
    }

    @Nullable
    public List<Class<?>> getTargetTypes() {
        return null;
    }

    @Nullable
    public String[] getTransitionProperties() {
        return null;
    }

    @Nullable
    public k0 getTransitionValues(@NonNull View view, boolean z10) {
        h0 h0Var = this.f32464k;
        if (h0Var != null) {
            return h0Var.getTransitionValues(view, z10);
        }
        return (k0) ((androidx.collection.f) (z10 ? this.f32462i : this.f32463j).f33125a).get(view);
    }

    public final void h(ViewGroup viewGroup, boolean z10) {
        i(z10);
        ArrayList arrayList = this.f32456e;
        int size = arrayList.size();
        ArrayList arrayList2 = this.f32458f;
        if (size <= 0 && arrayList2.size() <= 0) {
            e(viewGroup, z10);
            return;
        }
        for (int i10 = 0; i10 < arrayList.size(); i10++) {
            View viewFindViewById = viewGroup.findViewById(((Integer) arrayList.get(i10)).intValue());
            if (viewFindViewById != null) {
                k0 k0Var = new k0(viewFindViewById);
                if (z10) {
                    g(k0Var);
                } else {
                    d(k0Var);
                }
                k0Var.f32402c.add(this);
                f(k0Var);
                if (z10) {
                    c(this.f32462i, viewFindViewById, k0Var);
                } else {
                    c(this.f32463j, viewFindViewById, k0Var);
                }
            }
        }
        for (int i11 = 0; i11 < arrayList2.size(); i11++) {
            View view = (View) arrayList2.get(i11);
            k0 k0Var2 = new k0(view);
            if (z10) {
                g(k0Var2);
            } else {
                d(k0Var2);
            }
            k0Var2.f32402c.add(this);
            f(k0Var2);
            if (z10) {
                c(this.f32462i, view, k0Var2);
            } else {
                c(this.f32463j, view, k0Var2);
            }
        }
    }

    public final void i(boolean z10) {
        if (z10) {
            ((androidx.collection.f) this.f32462i.f33125a).clear();
            ((SparseArray) this.f32462i.f33126b).clear();
            ((androidx.collection.l) this.f32462i.f33127c).a();
        } else {
            ((androidx.collection.f) this.f32463j.f33125a).clear();
            ((SparseArray) this.f32463j.f33126b).clear();
            ((androidx.collection.l) this.f32463j.f33127c).a();
        }
    }

    public boolean isTransitionRequired(@Nullable k0 k0Var, @Nullable k0 k0Var2) {
        if (k0Var == null || k0Var2 == null) {
            return false;
        }
        String[] transitionProperties = getTransitionProperties();
        if (transitionProperties == null) {
            Iterator it = k0Var.f32400a.keySet().iterator();
            while (it.hasNext()) {
                if (v(k0Var, k0Var2, (String) it.next())) {
                }
            }
            return false;
        }
        for (String str : transitionProperties) {
            if (!v(k0Var, k0Var2, str)) {
            }
        }
        return false;
        return true;
    }

    @Override // 
    /* JADX INFO: renamed from: j */
    public z clone() {
        try {
            z zVar = (z) super.clone();
            zVar.f32449a0 = new ArrayList();
            zVar.f32462i = new u.e(2);
            zVar.f32463j = new u.e(2);
            zVar.f32466m = null;
            zVar.Q = null;
            zVar.f32457e0 = null;
            zVar.Y = this;
            zVar.Z = null;
            return zVar;
        } catch (CloneNotSupportedException e10) {
            throw new RuntimeException(e10);
        }
    }

    public void k(ViewGroup viewGroup, u.e eVar, u.e eVar2, ArrayList arrayList, ArrayList arrayList2) {
        int i10;
        View view;
        k0 k0Var;
        Animator animator;
        Animator animator2;
        k0 k0Var2;
        androidx.collection.f fVarR = r();
        SparseIntArray sparseIntArray = new SparseIntArray();
        int size = arrayList.size();
        boolean z10 = q().f32457e0 != null;
        int i11 = 0;
        while (i11 < size) {
            k0 k0Var3 = (k0) arrayList.get(i11);
            k0 k0Var4 = (k0) arrayList2.get(i11);
            if (k0Var3 != null && !k0Var3.f32402c.contains(this)) {
                k0Var3 = null;
            }
            if (k0Var4 != null && !k0Var4.f32402c.contains(this)) {
                k0Var4 = null;
            }
            if ((k0Var3 != null || k0Var4 != null) && (k0Var3 == null || k0Var4 == null || isTransitionRequired(k0Var3, k0Var4))) {
                Animator animatorCreateAnimator = createAnimator(viewGroup, k0Var3, k0Var4);
                if (animatorCreateAnimator != null) {
                    String str = this.f32448a;
                    if (k0Var4 != null) {
                        String[] transitionProperties = getTransitionProperties();
                        view = k0Var4.f32401b;
                        if (transitionProperties != null && transitionProperties.length > 0) {
                            k0Var2 = new k0(view);
                            k0 k0Var5 = (k0) ((androidx.collection.f) eVar2.f33125a).get(view);
                            i10 = size;
                            if (k0Var5 != null) {
                                int i12 = 0;
                                while (i12 < transitionProperties.length) {
                                    HashMap map = k0Var2.f32400a;
                                    String str2 = transitionProperties[i12];
                                    map.put(str2, k0Var5.f32400a.get(str2));
                                    i12++;
                                    transitionProperties = transitionProperties;
                                }
                            }
                            int i13 = fVarR.f968c;
                            int i14 = 0;
                            while (true) {
                                if (i14 >= i13) {
                                    animator2 = animatorCreateAnimator;
                                    break;
                                }
                                s sVar = (s) fVarR.get((Animator) fVarR.i(i14));
                                if (sVar.f32417c != null && sVar.f32415a == view && sVar.f32416b.equals(str) && sVar.f32417c.equals(k0Var2)) {
                                    animator2 = null;
                                    break;
                                }
                                i14++;
                            }
                        } else {
                            i10 = size;
                            animator2 = animatorCreateAnimator;
                            k0Var2 = null;
                        }
                        animator = animator2;
                        k0Var = k0Var2;
                    } else {
                        i10 = size;
                        view = k0Var3.f32401b;
                        k0Var = null;
                        animator = animatorCreateAnimator;
                    }
                    if (animator != null) {
                        WindowId windowId = viewGroup.getWindowId();
                        s sVar2 = new s();
                        sVar2.f32415a = view;
                        sVar2.f32416b = str;
                        sVar2.f32417c = k0Var;
                        sVar2.f32418d = windowId;
                        sVar2.f32419e = this;
                        sVar2.f32420f = animator;
                        Object obj = animator;
                        if (z10) {
                            AnimatorSet animatorSet = new AnimatorSet();
                            animatorSet.play(animator);
                            obj = animatorSet;
                        }
                        fVarR.put(obj, sVar2);
                        this.f32449a0.add(obj);
                    }
                }
                i11++;
                size = i10;
            }
            i10 = size;
            i11++;
            size = i10;
        }
        if (sparseIntArray.size() != 0) {
            for (int i15 = 0; i15 < sparseIntArray.size(); i15++) {
                s sVar3 = (s) fVarR.get((Animator) this.f32449a0.get(sparseIntArray.keyAt(i15)));
                sVar3.f32420f.setStartDelay(sVar3.f32420f.getStartDelay() + (((long) sparseIntArray.valueAt(i15)) - Long.MAX_VALUE));
            }
        }
    }

    public final void l() {
        int i10 = this.V - 1;
        this.V = i10;
        if (i10 == 0) {
            w(this, y.M, false);
            for (int i11 = 0; i11 < ((androidx.collection.l) this.f32462i.f33127c).f(); i11++) {
                View view = (View) ((androidx.collection.l) this.f32462i.f33127c).g(i11);
                if (view != null) {
                    view.setHasTransientState(false);
                }
            }
            for (int i12 = 0; i12 < ((androidx.collection.l) this.f32463j.f33127c).f(); i12++) {
                View view2 = (View) ((androidx.collection.l) this.f32463j.f33127c).g(i12);
                if (view2 != null) {
                    view2.setHasTransientState(false);
                }
            }
            this.X = true;
        }
    }

    public void m() {
        ArrayList arrayList = this.f32461h;
        if (arrayList == null) {
            arrayList = new ArrayList();
        }
        if (!arrayList.contains(TextView.class)) {
            arrayList.add(TextView.class);
        }
        this.f32461h = arrayList;
    }

    public void n(BaselineLayout baselineLayout) {
        ArrayList arrayList = this.f32460g;
        if (baselineLayout != null) {
            if (arrayList == null) {
                arrayList = new ArrayList();
            }
            if (!arrayList.contains(baselineLayout)) {
                arrayList.add(baselineLayout);
            }
        }
        this.f32460g = arrayList;
    }

    /* JADX WARN: Code restructure failed: missing block: B:22:0x002d, code lost:
    
        if (r3 < 0) goto L31;
     */
    /* JADX WARN: Code restructure failed: missing block: B:23:0x002f, code lost:
    
        if (r7 == false) goto L25;
     */
    /* JADX WARN: Code restructure failed: missing block: B:24:0x0031, code lost:
    
        r6 = r5.Q;
     */
    /* JADX WARN: Code restructure failed: missing block: B:25:0x0034, code lost:
    
        r6 = r5.f32466m;
     */
    /* JADX WARN: Code restructure failed: missing block: B:27:0x003d, code lost:
    
        return (r3.k0) r6.get(r3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:31:?, code lost:
    
        return null;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final k0 o(View view, boolean z10) {
        h0 h0Var = this.f32464k;
        if (h0Var != null) {
            return h0Var.o(view, z10);
        }
        ArrayList arrayList = z10 ? this.f32466m : this.Q;
        if (arrayList == null) {
            return null;
        }
        int size = arrayList.size();
        int i10 = 0;
        while (true) {
            if (i10 >= size) {
                i10 = -1;
                break;
            }
            k0 k0Var = (k0) arrayList.get(i10);
            if (k0Var == null) {
                return null;
            }
            if (k0Var.f32401b == view) {
                break;
            }
            i10++;
        }
    }

    @RestrictTo({RestrictTo.Scope.f557c})
    public void pause(@Nullable View view) {
        if (this.X) {
            return;
        }
        ArrayList arrayList = this.T;
        int size = arrayList.size();
        Animator[] animatorArr = (Animator[]) arrayList.toArray(this.U);
        this.U = f32444g0;
        for (int i10 = size - 1; i10 >= 0; i10--) {
            Animator animator = animatorArr[i10];
            animatorArr[i10] = null;
            animator.pause();
        }
        this.U = animatorArr;
        w(this, y.O, false);
        this.W = true;
    }

    public final z q() {
        h0 h0Var = this.f32464k;
        return h0Var != null ? h0Var.q() : this;
    }

    @RestrictTo({RestrictTo.Scope.f557c})
    public void resume(@Nullable View view) {
        if (this.W) {
            if (!this.X) {
                ArrayList arrayList = this.T;
                int size = arrayList.size();
                Animator[] animatorArr = (Animator[]) arrayList.toArray(this.U);
                this.U = f32444g0;
                for (int i10 = size - 1; i10 >= 0; i10--) {
                    Animator animator = animatorArr[i10];
                    animatorArr[i10] = null;
                    animator.resume();
                }
                this.U = animatorArr;
                w(this, y.P, false);
            }
            this.W = false;
        }
    }

    public boolean s() {
        return !this.T.isEmpty();
    }

    public void setEpicenterCallback(@Nullable t tVar) {
        this.f32451b0 = tVar;
    }

    @NonNull
    public z setInterpolator(@Nullable TimeInterpolator timeInterpolator) {
        this.f32454d = timeInterpolator;
        return this;
    }

    public void setMatchOrder(@Nullable int... iArr) {
        if (iArr == null || iArr.length == 0) {
            this.f32465l = f32445h0;
            return;
        }
        for (int i10 = 0; i10 < iArr.length; i10++) {
            int i11 = iArr[i10];
            if (i11 < 1 || i11 > 4) {
                throw new IllegalArgumentException("matches contains invalid value");
            }
            for (int i12 = 0; i12 < i10; i12++) {
                if (iArr[i12] == i11) {
                    throw new IllegalArgumentException("matches contains a duplicate value");
                }
            }
        }
        this.f32465l = (int[]) iArr.clone();
    }

    public void setPathMotion(@Nullable n nVar) {
        if (nVar == null) {
            this.f32453c0 = f32446i0;
        } else {
            this.f32453c0 = nVar;
        }
    }

    public void setPropagation(@Nullable e0 e0Var) {
    }

    public boolean t() {
        return this instanceof e;
    }

    public final String toString() {
        return G("");
    }

    public final boolean u(View view) {
        int id2 = view.getId();
        ArrayList arrayList = this.f32460g;
        if (arrayList != null && arrayList.contains(view)) {
            return false;
        }
        ArrayList arrayList2 = this.f32461h;
        if (arrayList2 != null) {
            int size = arrayList2.size();
            for (int i10 = 0; i10 < size; i10++) {
                if (((Class) this.f32461h.get(i10)).isInstance(view)) {
                    return false;
                }
            }
        }
        ArrayList arrayList3 = this.f32456e;
        int size2 = arrayList3.size();
        ArrayList arrayList4 = this.f32458f;
        return (size2 == 0 && arrayList4.size() == 0) || arrayList3.contains(Integer.valueOf(id2)) || arrayList4.contains(view);
    }

    public final void w(z zVar, androidx.core.view.n nVar, boolean z10) {
        z zVar2 = this.Y;
        if (zVar2 != null) {
            zVar2.w(zVar, nVar, z10);
        }
        ArrayList arrayList = this.Z;
        if (arrayList == null || arrayList.isEmpty()) {
            return;
        }
        int size = this.Z.size();
        x[] xVarArr = this.R;
        if (xVarArr == null) {
            xVarArr = new x[size];
        }
        this.R = null;
        x[] xVarArr2 = (x[]) this.Z.toArray(xVarArr);
        for (int i10 = 0; i10 < size; i10++) {
            x xVar = xVarArr2[i10];
            switch (nVar.f1787a) {
                case 20:
                    xVar.e(zVar);
                    break;
                case 21:
                    xVar.c(zVar);
                    break;
                case 22:
                    xVar.a(zVar);
                    break;
                case 23:
                    xVar.b();
                    break;
                default:
                    xVar.d();
                    break;
            }
            xVarArr2[i10] = null;
        }
        this.R = xVarArr2;
    }

    public final void x(androidx.core.view.n nVar) {
        w(this, nVar, false);
    }

    public void y() {
        androidx.collection.f fVarR = r();
        this.f32455d0 = 0L;
        for (int i10 = 0; i10 < this.f32449a0.size(); i10++) {
            Animator animator = (Animator) this.f32449a0.get(i10);
            s sVar = (s) fVarR.get(animator);
            if (animator != null && sVar != null) {
                long j10 = this.f32452c;
                Animator animator2 = sVar.f32420f;
                if (j10 >= 0) {
                    animator2.setDuration(j10);
                }
                long j11 = this.f32450b;
                if (j11 >= 0) {
                    animator2.setStartDelay(animator2.getStartDelay() + j11);
                }
                if (getInterpolator() != null) {
                    animator2.setInterpolator(getInterpolator());
                }
                this.T.add(animator);
                this.f32455d0 = Math.max(this.f32455d0, u.a(animator));
            }
        }
        this.f32449a0.clear();
    }

    public z z(x xVar) {
        z zVar;
        ArrayList arrayList = this.Z;
        if (arrayList == null) {
            return this;
        }
        if (!arrayList.remove(xVar) && (zVar = this.Y) != null) {
            zVar.z(xVar);
        }
        if (this.Z.size() == 0) {
            this.Z = null;
        }
        return this;
    }
}
