package o;

import android.os.Trace;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.jA, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1556jA extends LP implements InterfaceC0581Wk, InterfaceC1575jT, OP, InterfaceC0535Uq {
    public boolean A;
    public boolean B;
    public final int C;
    public final SC z;

    public C1556jA(int i, SC sc, int i2) {
        i = (i2 & 1) != 0 ? 1 : i;
        this.z = (i2 & 2) != 0 ? null : sc;
        this.C = i;
    }

    @Override // o.LP
    public final void A0() {
        int iOrdinal = J0().ordinal();
        if (iOrdinal != 0) {
            if (iOrdinal == 1) {
                return;
            }
            if (iOrdinal != 2) {
                if (iOrdinal != 3) {
                    throw new C2170pj();
                }
                return;
            }
        }
        C0674Zz c0674Zz = (C0674Zz) ((C2207q3) AbstractC2539te.T(this)).getFocusOwner();
        c0674Zz.b(8, true, false);
        c0674Zz.d.a();
    }

    @Override // o.LP
    public final void B0() {
        if (J0().a()) {
            ((C0674Zz) ((C2207q3) AbstractC2539te.T(this)).getFocusOwner()).b(8, true, true);
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r4v10 */
    /* JADX WARN: Type inference failed for: r4v11, types: [o.LP] */
    /* JADX WARN: Type inference failed for: r4v12, types: [java.lang.Object] */
    /* JADX WARN: Type inference failed for: r4v13 */
    /* JADX WARN: Type inference failed for: r4v14 */
    /* JADX WARN: Type inference failed for: r4v15 */
    /* JADX WARN: Type inference failed for: r4v16 */
    /* JADX WARN: Type inference failed for: r4v17 */
    /* JADX WARN: Type inference failed for: r4v18 */
    /* JADX WARN: Type inference failed for: r4v7 */
    /* JADX WARN: Type inference failed for: r4v8, types: [o.LP] */
    /* JADX WARN: Type inference failed for: r6v1 */
    /* JADX WARN: Type inference failed for: r6v10 */
    /* JADX WARN: Type inference failed for: r6v11 */
    /* JADX WARN: Type inference failed for: r6v12 */
    /* JADX WARN: Type inference failed for: r6v13 */
    /* JADX WARN: Type inference failed for: r6v2 */
    /* JADX WARN: Type inference failed for: r6v3 */
    /* JADX WARN: Type inference failed for: r6v4, types: [o.iR] */
    /* JADX WARN: Type inference failed for: r6v5 */
    /* JADX WARN: Type inference failed for: r6v6 */
    /* JADX WARN: Type inference failed for: r6v7, types: [o.iR] */
    public final void H0(EnumC1366hA enumC1366hA, EnumC1366hA enumC1366hA2) {
        C0312Mb c0312Mb;
        SC sc;
        C0674Zz c0674Zz = (C0674Zz) ((C2207q3) AbstractC2539te.T(this)).getFocusOwner();
        C1556jA c1556jA = c0674Zz.h;
        if (!enumC1366hA.equals(enumC1366hA2) && (sc = this.z) != null) {
            sc.f(enumC1366hA, enumC1366hA2);
        }
        LP lp = this.l;
        if (!lp.y) {
            AbstractC2133pH.b("visitAncestors called on an unattached node");
        }
        LP lp2 = this.l;
        C2420sK c2420sKS = AbstractC2539te.S(this);
        while (c2420sKS != null) {
            if ((((LP) c2420sKS.N.g).f209o & 5120) != 0) {
                while (lp2 != null) {
                    int i = lp2.n;
                    if ((i & 5120) != 0) {
                        if (lp2 != lp && (i & 1024) != 0) {
                            return;
                        }
                        if ((i & 4096) != 0) {
                            AbstractC0561Vq abstractC0561VqI = lp2;
                            ?? c1479iR = 0;
                            while (abstractC0561VqI != 0) {
                                if (abstractC0561VqI instanceof InterfaceC0414Pz) {
                                    InterfaceC0414Pz interfaceC0414Pz = (InterfaceC0414Pz) abstractC0561VqI;
                                    if (c1556jA == c0674Zz.h) {
                                        interfaceC0414Pz.Y(enumC1366hA2);
                                    }
                                } else if ((abstractC0561VqI.n & 4096) != 0 && (abstractC0561VqI instanceof AbstractC0561Vq)) {
                                    LP lp3 = abstractC0561VqI.A;
                                    int i2 = 0;
                                    abstractC0561VqI = abstractC0561VqI;
                                    c1479iR = c1479iR;
                                    while (lp3 != null) {
                                        if ((lp3.n & 4096) != 0) {
                                            i2++;
                                            c1479iR = c1479iR;
                                            if (i2 == 1) {
                                                abstractC0561VqI = lp3;
                                            } else {
                                                if (c1479iR == 0) {
                                                    c1479iR = new C1479iR(new LP[16]);
                                                }
                                                if (abstractC0561VqI != 0) {
                                                    c1479iR.b(abstractC0561VqI);
                                                    abstractC0561VqI = 0;
                                                }
                                                c1479iR.b(lp3);
                                            }
                                        }
                                        lp3 = lp3.q;
                                        abstractC0561VqI = abstractC0561VqI;
                                        c1479iR = c1479iR;
                                    }
                                    if (i2 == 1) {
                                    }
                                }
                                abstractC0561VqI = AbstractC2539te.i(c1479iR);
                            }
                        }
                    }
                    lp2 = lp2.p;
                }
            }
            c2420sKS = c2420sKS.s();
            lp2 = (c2420sKS == null || (c0312Mb = c2420sKS.N) == null) ? null : (Bc0) c0312Mb.f;
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r6v10 */
    /* JADX WARN: Type inference failed for: r6v11, types: [o.LP] */
    /* JADX WARN: Type inference failed for: r6v12, types: [java.lang.Object] */
    /* JADX WARN: Type inference failed for: r6v13 */
    /* JADX WARN: Type inference failed for: r6v14 */
    /* JADX WARN: Type inference failed for: r6v15 */
    /* JADX WARN: Type inference failed for: r6v16 */
    /* JADX WARN: Type inference failed for: r6v17 */
    /* JADX WARN: Type inference failed for: r6v18 */
    /* JADX WARN: Type inference failed for: r6v7 */
    /* JADX WARN: Type inference failed for: r6v8, types: [o.LP] */
    /* JADX WARN: Type inference failed for: r8v1 */
    /* JADX WARN: Type inference failed for: r8v10 */
    /* JADX WARN: Type inference failed for: r8v11 */
    /* JADX WARN: Type inference failed for: r8v12 */
    /* JADX WARN: Type inference failed for: r8v13 */
    /* JADX WARN: Type inference failed for: r8v2 */
    /* JADX WARN: Type inference failed for: r8v3 */
    /* JADX WARN: Type inference failed for: r8v4, types: [o.iR] */
    /* JADX WARN: Type inference failed for: r8v5 */
    /* JADX WARN: Type inference failed for: r8v6 */
    /* JADX WARN: Type inference failed for: r8v7, types: [o.iR] */
    public final C0792bA I0() {
        boolean z;
        C0312Mb c0312Mb;
        C0792bA c0792bA = new C0792bA();
        c0792bA.a = true;
        C0983dA c0983dA = C0983dA.b;
        c0792bA.b = c0983dA;
        c0792bA.c = c0983dA;
        c0792bA.d = c0983dA;
        c0792bA.e = c0983dA;
        c0792bA.f = c0983dA;
        c0792bA.g = c0983dA;
        c0792bA.h = c0983dA;
        c0792bA.i = c0983dA;
        c0792bA.j = C2291qw.q;
        c0792bA.k = C2291qw.r;
        int i = this.C;
        if (i == 1) {
            z = true;
        } else if (i == 0) {
            z = !(((FH) ((HH) ((GH) AbstractC2461sm0.j(this, AbstractC0840bl.m))).a.getValue()).a == 1);
        } else {
            if (i != 2) {
                throw new IllegalStateException("Unknown Focusability");
            }
            z = false;
        }
        c0792bA.a = z;
        LP lp = this.l;
        if (!lp.y) {
            AbstractC2133pH.b("visitAncestors called on an unattached node");
        }
        LP lp2 = this.l;
        C2420sK c2420sKS = AbstractC2539te.S(this);
        loop0: while (c2420sKS != null) {
            if ((((LP) c2420sKS.N.g).f209o & 3072) != 0) {
                while (lp2 != null) {
                    int i2 = lp2.n;
                    if ((i2 & 3072) != 0) {
                        if (lp2 != lp && (i2 & 1024) != 0) {
                            break loop0;
                        }
                        if ((i2 & 2048) != 0) {
                            AbstractC0561Vq abstractC0561VqI = lp2;
                            ?? c1479iR = 0;
                            while (abstractC0561VqI != 0) {
                                if (abstractC0561VqI instanceof InterfaceC0887cA) {
                                    ((InterfaceC0887cA) abstractC0561VqI).S(c0792bA);
                                } else if ((abstractC0561VqI.n & 2048) != 0 && (abstractC0561VqI instanceof AbstractC0561Vq)) {
                                    LP lp3 = abstractC0561VqI.A;
                                    int i3 = 0;
                                    abstractC0561VqI = abstractC0561VqI;
                                    c1479iR = c1479iR;
                                    while (lp3 != null) {
                                        if ((lp3.n & 2048) != 0) {
                                            i3++;
                                            c1479iR = c1479iR;
                                            if (i3 == 1) {
                                                abstractC0561VqI = lp3;
                                            } else {
                                                if (c1479iR == 0) {
                                                    c1479iR = new C1479iR(new LP[16]);
                                                }
                                                if (abstractC0561VqI != 0) {
                                                    c1479iR.b(abstractC0561VqI);
                                                    abstractC0561VqI = 0;
                                                }
                                                c1479iR.b(lp3);
                                            }
                                        }
                                        lp3 = lp3.q;
                                        abstractC0561VqI = abstractC0561VqI;
                                        c1479iR = c1479iR;
                                    }
                                    if (i3 == 1) {
                                    }
                                }
                                abstractC0561VqI = AbstractC2539te.i(c1479iR);
                            }
                        }
                    }
                    lp2 = lp2.p;
                }
            }
            c2420sKS = c2420sKS.s();
            lp2 = (c2420sKS == null || (c0312Mb = c2420sKS.N) == null) ? null : (Bc0) c0312Mb.f;
        }
        return c0792bA;
    }

    public final EnumC1366hA J0() {
        C0674Zz c0674Zz;
        C1556jA c1556jA;
        C0312Mb c0312Mb;
        if (this.y && (c1556jA = (c0674Zz = (C0674Zz) ((C2207q3) AbstractC2539te.T(this)).getFocusOwner()).h) != null) {
            if (this == c1556jA) {
                c0674Zz.getClass();
                return EnumC1366hA.l;
            }
            if (c1556jA.y) {
                if (!c1556jA.l.y) {
                    AbstractC2133pH.b("visitAncestors called on an unattached node");
                }
                LP lp = c1556jA.l.p;
                C2420sK c2420sKS = AbstractC2539te.S(c1556jA);
                while (c2420sKS != null) {
                    if ((((LP) c2420sKS.N.g).f209o & 1024) != 0) {
                        while (lp != null) {
                            if ((lp.n & 1024) != 0) {
                                LP lpI = lp;
                                C1479iR c1479iR = null;
                                while (lpI != null) {
                                    if (lpI instanceof C1556jA) {
                                        if (this == ((C1556jA) lpI)) {
                                            return EnumC1366hA.m;
                                        }
                                    } else if ((lpI.n & 1024) != 0 && (lpI instanceof AbstractC0561Vq)) {
                                        int i = 0;
                                        for (LP lp2 = ((AbstractC0561Vq) lpI).A; lp2 != null; lp2 = lp2.q) {
                                            if ((lp2.n & 1024) != 0) {
                                                i++;
                                                if (i == 1) {
                                                    lpI = lp2;
                                                } else {
                                                    if (c1479iR == null) {
                                                        c1479iR = new C1479iR(new LP[16]);
                                                    }
                                                    if (lpI != null) {
                                                        c1479iR.b(lpI);
                                                        lpI = null;
                                                    }
                                                    c1479iR.b(lp2);
                                                }
                                            }
                                        }
                                        if (i == 1) {
                                        }
                                    }
                                    lpI = AbstractC2539te.i(c1479iR);
                                }
                            }
                            lp = lp.p;
                        }
                    }
                    c2420sKS = c2420sKS.s();
                    lp = (c2420sKS == null || (c0312Mb = c2420sKS.N) == null) ? null : (Bc0) c0312Mb.f;
                }
            }
        }
        return EnumC1366hA.f556o;
    }

    @Override // o.InterfaceC1575jT
    public final void K() {
        K0();
    }

    public final void K0() {
        int iOrdinal = J0().ordinal();
        if (iOrdinal != 0) {
            if (iOrdinal == 1) {
                return;
            }
            if (iOrdinal != 2) {
                if (iOrdinal != 3) {
                    throw new C2170pj();
                }
                return;
            }
        }
        B10 b10 = new B10();
        AbstractC2841wm0.A(this, new C1352h3(5, b10, this));
        Object obj = b10.l;
        if ((obj == null ? null : (InterfaceC0696aA) obj).b()) {
            return;
        }
        ((C0674Zz) ((C2207q3) AbstractC2539te.T(this)).getFocusOwner()).b(8, true, true);
    }

    public final boolean L0(int i) {
        Trace.beginSection("FocusTransactions:requestFocus");
        try {
            boolean zB = false;
            if (!I0().a) {
                Trace.endSection();
                return false;
            }
            int iW = AbstractC2462sn.w(AbstractC0662Zn.A(this, i));
            if (iW == 0) {
                zB = AbstractC0662Zn.B(this);
            } else if (iW != 1) {
                if (iW == 2) {
                    zB = true;
                } else if (iW != 3) {
                    throw new C2170pj();
                }
            }
            return zB;
        } finally {
            Trace.endSection();
        }
    }

    @Override // o.LP
    public final boolean w0() {
        return false;
    }
}
