package o;

import android.os.SystemClock;
import android.view.MotionEvent;
import androidx.compose.ui.semantics.AppendedSemanticsElement;
import java.util.HashSet;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Hc, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C0184Hc extends LP implements InterfaceC1851mK, InterfaceC1905mt, P50, LX, OP, PP, NV, InterfaceC0993dK, SD, InterfaceC0414Pz, InterfaceC0887cA, InterfaceC1078eA, InterfaceC1672kV, InterfaceC1877mf {
    public C0132Fc A;
    public HashSet B;
    public KP z;

    @Override // o.LP
    public final void A0() {
        I0();
    }

    @Override // o.InterfaceC1672kV
    public final boolean C() {
        return this.y;
    }

    public final void H0(boolean z) {
        C3100zZ c3100zZ = AbstractC2461sm0.h;
        if (!this.y) {
            AbstractC2133pH.b("initializeModifier called on unattached node");
        }
        KP kp = this.z;
        if ((this.n & 32) != 0) {
            if (kp instanceof QH) {
                C0158Gc c0158Gc = new C0158Gc(this, 0);
                UQ uq = ((C2207q3) AbstractC2539te.T(this)).G0;
                if (uq.f(c0158Gc) < 0) {
                    uq.a(c0158Gc);
                }
            }
            if (kp instanceof QH) {
                QH qh = (QH) kp;
                C0132Fc c0132Fc = this.A;
                if (c0132Fc == null || !c0132Fc.r(c3100zZ)) {
                    C0132Fc c0132Fc2 = new C0132Fc();
                    c0132Fc2.l = qh;
                    this.A = c0132Fc2;
                    if (((Bc0) AbstractC2539te.S(this).N.f).z) {
                        NP modifierLocalManager = ((C2207q3) AbstractC2539te.T(this)).getModifierLocalManager();
                        modifierLocalManager.b.b(this);
                        modifierLocalManager.c.b(c3100zZ);
                        modifierLocalManager.a();
                    }
                } else {
                    c0132Fc.l = qh;
                    NP modifierLocalManager2 = ((C2207q3) AbstractC2539te.T(this)).getModifierLocalManager();
                    modifierLocalManager2.b.b(this);
                    modifierLocalManager2.c.b(c3100zZ);
                    modifierLocalManager2.a();
                }
            }
        }
        if ((this.n & 4) != 0 && !z) {
            AbstractC2539te.Q(this, 2).W0();
        }
        if ((this.n & 2) != 0) {
            if (((Bc0) AbstractC2539te.S(this).N.f).z) {
                AbstractC2239qS abstractC2239qS = this.s;
                ((C2041oK) abstractC2239qS).r1(this);
                InterfaceC1483iV interfaceC1483iV = abstractC2239qS.T;
                if (interfaceC1483iV != null) {
                    ((C1274gE) interfaceC1483iV).invalidate();
                }
            }
            if (!z) {
                AbstractC2539te.Q(this, 2).W0();
                AbstractC2539te.S(this).B();
            }
        }
        int i = this.n;
        if ((i & 16) != 0 && (kp instanceof NX)) {
            ((NX) kp).d.b = this.s;
        }
        if ((i & 8) != 0) {
            ((C2207q3) AbstractC2539te.T(this)).B();
        }
    }

    public final void I0() {
        C3100zZ c3100zZ = AbstractC2461sm0.h;
        if (!this.y) {
            AbstractC2133pH.b("unInitializeModifier called on unattached node");
        }
        KP kp = this.z;
        if ((this.n & 32) != 0) {
            if (kp instanceof QH) {
                NP modifierLocalManager = ((C2207q3) AbstractC2539te.T(this)).getModifierLocalManager();
                modifierLocalManager.d.b(AbstractC2539te.S(this));
                modifierLocalManager.e.b(c3100zZ);
                modifierLocalManager.a();
            }
            if (kp instanceof QH) {
                QH qh = (QH) kp;
                InterfaceC1795ll0 interfaceC1795ll0 = (InterfaceC1795ll0) c3100zZ.a.a();
                InterfaceC1795ll0 interfaceC1795ll02 = qh.a;
                qh.b.setValue(new C0619Xw(interfaceC1795ll02, interfaceC1795ll0));
                qh.c.setValue(new Nh0(interfaceC1795ll0, interfaceC1795ll02));
            }
        }
        if ((this.n & 8) != 0) {
            ((C2207q3) AbstractC2539te.T(this)).B();
        }
    }

    public final void J0() {
        if (this.y) {
            this.B.clear();
            ((C2207q3) AbstractC2539te.T(this)).getSnapshotObserver().a(this, C1160f3.G, new C0158Gc(this, 1));
        }
    }

    @Override // o.LX
    public final boolean R() {
        ((NX) this.z).d.getClass();
        return true;
    }

    @Override // o.InterfaceC0887cA
    public final void S(InterfaceC0696aA interfaceC0696aA) {
        KP kp = this.z;
        AbstractC2133pH.b("applyFocusProperties called on wrong node");
        kp.getClass();
        throw new ClassCastException();
    }

    @Override // o.SD
    public final void U(AbstractC2239qS abstractC2239qS) {
        this.z.getClass();
        throw new ClassCastException();
    }

    @Override // o.InterfaceC0414Pz
    public final void Y(EnumC1366hA enumC1366hA) {
        KP kp = this.z;
        AbstractC2133pH.b("onFocusEvent called on wrong node");
        kp.getClass();
        throw new ClassCastException();
    }

    /* JADX WARN: Type inference failed for: r0v0, types: [java.lang.Object, java.util.Collection, java.util.List] */
    @Override // o.LX
    public final void Z(CX cx, DX dx, long j) {
        boolean z;
        boolean z2;
        boolean z3;
        Ew0 ew0 = ((NX) this.z).d;
        NX nx = (NX) ew0.d;
        ?? r0 = cx.a;
        int size = r0.size();
        for (int i = 0; i < size; i++) {
            IX ix = (IX) r0.get(i);
            if (As0.p(ix) || As0.r(ix)) {
                z = false;
                break;
            }
        }
        z = true;
        if (!z) {
            z2 = false;
            break;
        }
        int size2 = r0.size();
        for (int i2 = 0; i2 < size2; i2++) {
            if (((IX) r0.get(i2)).b()) {
                z2 = false;
                break;
            }
        }
        z2 = true;
        if (nx.c) {
            z3 = true;
        } else {
            int size3 = r0.size();
            int i3 = 0;
            while (true) {
                if (i3 < size3) {
                    IX ix2 = (IX) r0.get(i3);
                    if (As0.p(ix2) || As0.r(ix2)) {
                        break;
                    } else {
                        i3++;
                    }
                } else if (z2) {
                    break;
                } else {
                    z3 = false;
                }
            }
            z3 = true;
        }
        int i4 = ew0.a;
        DX dx2 = DX.n;
        if (i4 != 3) {
            if (dx == DX.l && z3) {
                ew0.c = cx;
                ew0.a(cx, !z || nx.c);
            }
            if (dx == DX.m && z && cx.equals((CX) ew0.c) && nx.c) {
                int size4 = r0.size();
                for (int i5 = 0; i5 < size4; i5++) {
                    ((IX) r0.get(i5)).a();
                }
            }
            if (dx == dx2 && !z3 && !cx.equals((CX) ew0.c)) {
                ew0.a(cx, true);
            }
        }
        if (dx == dx2) {
            int size5 = r0.size();
            int i6 = 0;
            while (true) {
                if (i6 >= size5) {
                    ew0.a = 1;
                    nx.c = false;
                    ew0.c = null;
                    break;
                } else if (!As0.r((IX) r0.get(i6))) {
                    break;
                } else {
                    i6++;
                }
            }
            if (cx.equals((CX) ew0.c) && z) {
                int size6 = r0.size();
                int i7 = 0;
                while (true) {
                    if (i7 >= size6) {
                        break;
                    }
                    if (!((IX) r0.get(i7)).b()) {
                        i7++;
                    } else if (!nx.c) {
                        ew0.k(cx);
                        return;
                    }
                }
                int size7 = r0.size();
                for (int i8 = 0; i8 < size7; i8++) {
                    ((IX) r0.get(i8)).a();
                }
            }
        }
    }

    @Override // o.InterfaceC1851mK
    public final InterfaceC2329rO a(InterfaceC2424sO interfaceC2424sO, InterfaceC1760lO interfaceC1760lO, long j) {
        return ((InterfaceC1661kK) this.z).a(interfaceC2424sO, interfaceC1760lO, j);
    }

    @Override // o.LX
    public final void a0() {
        Ew0 ew0 = ((NX) this.z).d;
        NX nx = (NX) ew0.d;
        if (ew0.a == 2) {
            long jUptimeMillis = SystemClock.uptimeMillis();
            MotionEvent motionEventObtain = MotionEvent.obtain(jUptimeMillis, jUptimeMillis, 3, 0.0f, 0.0f, 0);
            motionEventObtain.setSource(0);
            T5 t5 = nx.a;
            if (t5 == null) {
                t5 = null;
            }
            t5.g(motionEventObtain);
            motionEventObtain.recycle();
            ew0.a = 1;
            nx.c = false;
            ew0.c = null;
        }
    }

    @Override // o.InterfaceC1851mK
    public final int b(YM ym, InterfaceC1760lO interfaceC1760lO, int i) {
        return ((InterfaceC1661kK) this.z).b(ym, interfaceC1760lO, i);
    }

    @Override // o.InterfaceC0535Uq, o.LX
    public final void c() {
        if (this.z instanceof NX) {
            a0();
        }
    }

    @Override // o.InterfaceC1851mK
    public final int d(YM ym, InterfaceC1760lO interfaceC1760lO, int i) {
        return ((InterfaceC1661kK) this.z).d(ym, interfaceC1760lO, i);
    }

    @Override // o.P50
    public final void d0(N50 n50) {
        int i;
        AppendedSemanticsElement appendedSemanticsElement = (AppendedSemanticsElement) this.z;
        appendedSemanticsElement.getClass();
        N50 n502 = new N50();
        n502.n = appendedSemanticsElement.a;
        appendedSemanticsElement.b.g(n502);
        ZQ zq = n50.l;
        if (n502.n) {
            n50.n = true;
        }
        if (n502.f250o) {
            n50.f250o = true;
        }
        ZQ zq2 = n502.l;
        Object[] objArr = zq2.b;
        Object[] objArr2 = zq2.c;
        long[] jArr = zq2.a;
        int length = jArr.length - 2;
        if (length < 0) {
            return;
        }
        int i2 = 0;
        while (true) {
            long j = jArr[i2];
            if ((((~j) << 7) & j & (-9187201950435737472L)) != -9187201950435737472L) {
                int i3 = 8;
                int i4 = 8 - ((~(i2 - length)) >>> 31);
                int i5 = 0;
                while (i5 < i4) {
                    if ((255 & j) < 128) {
                        int i6 = (i2 << 3) + i5;
                        Object obj = objArr[i6];
                        Object obj2 = objArr2[i6];
                        Z50 z50 = (Z50) obj;
                        if (!zq.b(z50)) {
                            zq.m(z50, obj2);
                        } else if (obj2 instanceof C1726l0) {
                            C1726l0 c1726l0 = (C1726l0) zq.g(z50);
                            i = i3;
                            String str = c1726l0.a;
                            if (str == null) {
                                str = ((C1726l0) obj2).a;
                            }
                            QC qc = c1726l0.b;
                            if (qc == null) {
                                qc = ((C1726l0) obj2).b;
                            }
                            zq.m(z50, new C1726l0(str, qc));
                        }
                        i = i3;
                    } else {
                        i = i3;
                    }
                    j >>= i;
                    i5++;
                    i3 = i;
                }
                if (i4 != i3) {
                    return;
                }
            }
            if (i2 == length) {
                return;
            } else {
                i2++;
            }
        }
    }

    @Override // o.InterfaceC1877mf
    public final InterfaceC2281qr e() {
        return AbstractC2539te.S(this).I;
    }

    @Override // o.InterfaceC1877mf
    public final long f() {
        return C1884mi0.O(AbstractC2539te.Q(this, 128).n);
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r2v10 */
    /* JADX WARN: Type inference failed for: r2v11, types: [o.LP] */
    /* JADX WARN: Type inference failed for: r2v12, types: [java.lang.Object] */
    /* JADX WARN: Type inference failed for: r2v13 */
    /* JADX WARN: Type inference failed for: r2v14 */
    /* JADX WARN: Type inference failed for: r2v15 */
    /* JADX WARN: Type inference failed for: r2v16 */
    /* JADX WARN: Type inference failed for: r2v17 */
    /* JADX WARN: Type inference failed for: r2v18 */
    /* JADX WARN: Type inference failed for: r2v7 */
    /* JADX WARN: Type inference failed for: r2v8, types: [o.LP] */
    /* JADX WARN: Type inference failed for: r4v0 */
    /* JADX WARN: Type inference failed for: r4v1 */
    /* JADX WARN: Type inference failed for: r4v10 */
    /* JADX WARN: Type inference failed for: r4v11 */
    /* JADX WARN: Type inference failed for: r4v2 */
    /* JADX WARN: Type inference failed for: r4v3, types: [o.iR] */
    /* JADX WARN: Type inference failed for: r4v4 */
    /* JADX WARN: Type inference failed for: r4v5 */
    /* JADX WARN: Type inference failed for: r4v6, types: [o.iR] */
    /* JADX WARN: Type inference failed for: r4v8 */
    /* JADX WARN: Type inference failed for: r4v9 */
    @Override // o.OP, o.PP
    public final Object g(C3100zZ c3100zZ) {
        C0312Mb c0312Mb;
        this.B.add(c3100zZ);
        if (!this.l.y) {
            AbstractC2133pH.b("visitAncestors called on an unattached node");
        }
        LP lp = this.l.p;
        C2420sK c2420sKS = AbstractC2539te.S(this);
        while (c2420sKS != null) {
            if ((((LP) c2420sKS.N.g).f209o & 32) != 0) {
                while (lp != null) {
                    if ((lp.n & 32) != 0) {
                        AbstractC0561Vq abstractC0561VqI = lp;
                        ?? c1479iR = 0;
                        while (abstractC0561VqI != 0) {
                            if (abstractC0561VqI instanceof OP) {
                                OP op = (OP) abstractC0561VqI;
                                if (op.l().r(c3100zZ)) {
                                    return op.l().v(c3100zZ);
                                }
                            } else if ((abstractC0561VqI.n & 32) != 0 && (abstractC0561VqI instanceof AbstractC0561Vq)) {
                                LP lp2 = abstractC0561VqI.A;
                                int i = 0;
                                abstractC0561VqI = abstractC0561VqI;
                                c1479iR = c1479iR;
                                while (lp2 != null) {
                                    if ((lp2.n & 32) != 0) {
                                        i++;
                                        c1479iR = c1479iR;
                                        if (i == 1) {
                                            abstractC0561VqI = lp2;
                                        } else {
                                            if (c1479iR == 0) {
                                                c1479iR = new C1479iR(new LP[16]);
                                            }
                                            if (abstractC0561VqI != 0) {
                                                c1479iR.b(abstractC0561VqI);
                                                abstractC0561VqI = 0;
                                            }
                                            c1479iR.b(lp2);
                                        }
                                    }
                                    lp2 = lp2.q;
                                    abstractC0561VqI = abstractC0561VqI;
                                    c1479iR = c1479iR;
                                }
                                if (i == 1) {
                                }
                            }
                            abstractC0561VqI = AbstractC2539te.i(c1479iR);
                        }
                    }
                    lp = lp.p;
                }
            }
            c2420sKS = c2420sKS.s();
            lp = (c2420sKS == null || (c0312Mb = c2420sKS.N) == null) ? null : (Bc0) c0312Mb.f;
        }
        return c3100zZ.a.a();
    }

    @Override // o.NV
    public final Object g0(Object obj) {
        C2877x6 c2877x6 = (C2877x6) this.z;
        c2877x6.getClass();
        return c2877x6;
    }

    @Override // o.InterfaceC1877mf
    public final EnumC1280gK getLayoutDirection() {
        return AbstractC2539te.S(this).J;
    }

    @Override // o.InterfaceC1851mK
    public final int h(YM ym, InterfaceC1760lO interfaceC1760lO, int i) {
        return ((InterfaceC1661kK) this.z).h(ym, interfaceC1760lO, i);
    }

    @Override // o.InterfaceC1905mt
    public final void h0() {
        AbstractC2461sm0.A(this);
    }

    @Override // o.InterfaceC1851mK
    public final int i(YM ym, InterfaceC1760lO interfaceC1760lO, int i) {
        return ((InterfaceC1661kK) this.z).i(ym, interfaceC1760lO, i);
    }

    @Override // o.OP
    public final F3 l() {
        C0132Fc c0132Fc = this.A;
        return c0132Fc != null ? c0132Fc : C0384Ov.l;
    }

    @Override // o.LX
    public final void l0() {
        Ew0 ew0 = ((NX) this.z).d;
    }

    @Override // o.InterfaceC1905mt
    public final void r(C2610uK c2610uK) {
        C2365rm c2365rm = (C2365rm) this.z;
        c2365rm.getClass();
        C3113zg c3113zg = c2610uK.l;
        long jZ0 = c2365rm.z0(c3113zg.f());
        InterfaceC2584u2 interfaceC2584u2 = c2365rm.k;
        int i = AbstractC2548ti0.b;
        long jF = c3113zg.f();
        long jA = interfaceC2584u2.a((C2887xC.D(T80.b(jZ0)) & 4294967295L) | (C2887xC.D(T80.d(jZ0)) << 32), (C2887xC.D(T80.d(jF)) << 32) | (C2887xC.D(T80.b(jF)) & 4294967295L), c2610uK.getLayoutDirection());
        float f = (int) (jA >> 32);
        float f2 = (int) (jA & 4294967295L);
        C3126zm0 c3126zm0 = c3113zg.m;
        ((OD) c3126zm0.m).I(f, f2);
        c2365rm.j.f(c2610uK, jZ0, c2365rm.m, null);
        ((OD) c3126zm0.m).I(-f, -f2);
        c2610uK.a();
    }

    public final String toString() {
        return this.z.toString();
    }

    @Override // o.LP
    public final void z0() {
        H0(true);
    }

    @Override // o.InterfaceC0993dK
    public final void p(InterfaceC1184fK interfaceC1184fK) {
    }

    @Override // o.InterfaceC0993dK
    public final void v(long j) {
    }
}
