package G;

import F.AbstractC0158l;
import F.C0150d;
import F.C0156j;
import G0.s0;
import androidx.compose.runtime.MutableFloatState;
import androidx.compose.runtime.MutableIntState;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.SnapshotIntStateKt;
import androidx.compose.runtime.SnapshotStateKt;
import androidx.compose.runtime.SnapshotStateKt__SnapshotStateKt;
import androidx.compose.runtime.State;
import androidx.compose.runtime.snapshots.Snapshot;
import m3.AbstractC2467b;
import o0.C2631b;
import q.AbstractC2771e;
import q.F0;
import q.InterfaceC2787m;
import v.z0;
import w4.C3137A;
import x.C3189q;
import x.EnumC3207z0;
import x.InterfaceC3146a1;
import x4.AbstractC3251q;

/* JADX INFO: loaded from: classes.dex */
public abstract class L implements InterfaceC3146a1 {

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    public final MutableState f1678A;

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    public final D.E f1679B;

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

    /* JADX INFO: renamed from: D, reason: collision with root package name */
    public final F.N f1681D;

    /* JADX INFO: renamed from: E, reason: collision with root package name */
    public final MutableState f1682E;

    /* JADX INFO: renamed from: F, reason: collision with root package name */
    public final MutableState f1683F;

    /* JADX INFO: renamed from: G, reason: collision with root package name */
    public final MutableState f1684G;

    /* JADX INFO: renamed from: H, reason: collision with root package name */
    public final MutableState f1685H;

    /* JADX INFO: renamed from: I, reason: collision with root package name */
    public final MutableState f1686I;

    /* JADX INFO: renamed from: J, reason: collision with root package name */
    public final MutableState f1687J;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public boolean f1688a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public y f1689b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final MutableState f1690c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final B f1691d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public int f1692e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public int f1693f;

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

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

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public float f1696i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public float f1697j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final C3189q f1698k;
    public final boolean l;

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

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public F.P f1700n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public boolean f1701o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    public final MutableState f1702p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    public h1.c f1703q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    public final z.m f1704r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public final MutableIntState f1705s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public final MutableIntState f1706t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    public final State f1707u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final State f1708v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public final F.Q f1709w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public final C0238m f1710x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public final C0156j f1711y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    public final C0150d f1712z;

    /* JADX WARN: Type inference failed for: r3v2, types: [G.F] */
    public L(int i6, float f6) {
        double d6 = f6;
        if (-0.5d > d6 || d6 > 0.5d) {
            A.b.a("currentPageOffsetFraction " + f6 + " is not within the range -0.5 to 0.5");
        }
        this.f1690c = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(new C2631b(0L), null, 2, null);
        this.f1691d = new B(i6, f6, this);
        this.f1692e = i6;
        this.f1694g = Long.MAX_VALUE;
        final int i7 = 0;
        this.f1698k = new C3189q(new J4.c(this) { // from class: G.E

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ L f1653b;

            {
                this.f1653b = this;
            }

            /* JADX WARN: Multi-variable type inference failed */
            /* JADX WARN: Type inference failed for: r14v1, types: [java.lang.Float] */
            /* JADX WARN: Type inference failed for: r14v3, types: [java.lang.Number] */
            /* JADX WARN: Type inference failed for: r14v4, types: [java.lang.Long] */
            @Override // J4.c
            public final Object invoke(Object obj) {
                y yVar;
                switch (i7) {
                    case 0:
                        ?? ValueOf = (Float) obj;
                        float fFloatValue = ValueOf.floatValue();
                        L l = this.f1653b;
                        l.getClass();
                        long jU = e4.C.u(l);
                        float f7 = l.f1696i + fFloatValue;
                        long jE0 = L4.a.e0(f7);
                        l.f1696i = f7 - jE0;
                        if (Math.abs(fFloatValue) >= 1.0E-4f) {
                            long j4 = jU + jE0;
                            long jX = L4.a.x(j4, l.f1695h, l.f1694g);
                            boolean z6 = j4 != jX;
                            long j6 = jX - jU;
                            float f8 = j6;
                            l.f1697j = f8;
                            if (Math.abs(j6) != 0) {
                                l.f1686I.setValue(Boolean.valueOf(f8 > 0.0f));
                                l.f1687J.setValue(Boolean.valueOf(f8 < 0.0f));
                            }
                            int i8 = (int) j6;
                            int i9 = -i8;
                            y yVarA = ((y) l.f1702p.getValue()).a(i9);
                            if (yVarA != null && (yVar = l.f1689b) != null) {
                                y yVarA2 = yVar.a(i9);
                                if (yVarA2 != null) {
                                    l.f1689b = yVarA2;
                                } else {
                                    yVarA = null;
                                }
                            }
                            if (yVarA != null) {
                                l.h(yVarA, l.f1688a, true);
                                l.f1682E.setValue(C3137A.f25453a);
                            } else {
                                B b5 = l.f1691d;
                                float fQ = ((L) b5.f1645b).q() != 0 ? i8 / r6.q() : 0.0f;
                                MutableFloatState mutableFloatState = (MutableFloatState) b5.f1647d;
                                mutableFloatState.setFloatValue(mutableFloatState.getFloatValue() + fQ);
                                s0 s0Var = (s0) l.f1678A.getValue();
                                if (s0Var != null) {
                                    ((I0.H) s0Var).i();
                                }
                            }
                            if (z6) {
                                ValueOf = Long.valueOf(j6);
                            }
                            fFloatValue = ValueOf.floatValue();
                        }
                        return Float.valueOf(fFloatValue);
                    default:
                        L l6 = this.f1653b;
                        F.O o6 = (F.O) obj;
                        Snapshot.Companion companion = Snapshot.Companion;
                        Snapshot currentThreadSnapshot = companion.getCurrentThreadSnapshot();
                        J4.c readObserver = currentThreadSnapshot != null ? currentThreadSnapshot.getReadObserver() : null;
                        Snapshot snapshotMakeCurrentNonObservable = companion.makeCurrentNonObservable(currentThreadSnapshot);
                        try {
                            o6.a(l6.f1692e);
                            companion.restoreNonObservable(currentThreadSnapshot, snapshotMakeCurrentNonObservable, readObserver);
                            return C3137A.f25453a;
                        } catch (Throwable th) {
                            companion.restoreNonObservable(currentThreadSnapshot, snapshotMakeCurrentNonObservable, readObserver);
                            throw th;
                        }
                }
            }
        });
        this.l = true;
        this.f1699m = -1;
        this.f1702p = SnapshotStateKt.mutableStateOf(P.f1718c, SnapshotStateKt.neverEqualPolicy());
        this.f1703q = P.f1717b;
        this.f1704r = new z.m();
        this.f1705s = SnapshotIntStateKt.mutableIntStateOf(-1);
        this.f1706t = SnapshotIntStateKt.mutableIntStateOf(i6);
        final int i8 = 0;
        this.f1707u = SnapshotStateKt.derivedStateOf(SnapshotStateKt.structuralEqualityPolicy(), new J4.a(this) { // from class: G.F

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ L f1655b;

            {
                this.f1655b = this;
            }

            @Override // J4.a
            public final Object invoke() {
                int intValue;
                switch (i8) {
                    case 0:
                        L l = this.f1655b;
                        return Integer.valueOf(l.f1698k.a() ? l.f1706t.getIntValue() : l.l());
                    case 1:
                        L l6 = this.f1655b;
                        if (l6.f1698k.a()) {
                            MutableIntState mutableIntState = l6.f1705s;
                            intValue = mutableIntState.getIntValue() != -1 ? mutableIntState.getIntValue() : Math.abs(l6.m()) >= Math.abs(Math.min(l6.f1703q.Y(P.f1716a), ((float) l6.p()) / 2.0f) / ((float) l6.p())) ? ((Boolean) l6.f1686I.getValue()).booleanValue() ? l6.f1692e + 1 : l6.f1692e : l6.l();
                        } else {
                            intValue = l6.l();
                        }
                        return Integer.valueOf(l6.k(intValue));
                    default:
                        return Integer.valueOf(this.f1655b.o());
                }
            }
        });
        final int i9 = 1;
        this.f1708v = SnapshotStateKt.derivedStateOf(SnapshotStateKt.structuralEqualityPolicy(), new J4.a(this) { // from class: G.F

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ L f1655b;

            {
                this.f1655b = this;
            }

            @Override // J4.a
            public final Object invoke() {
                int intValue;
                switch (i9) {
                    case 0:
                        L l = this.f1655b;
                        return Integer.valueOf(l.f1698k.a() ? l.f1706t.getIntValue() : l.l());
                    case 1:
                        L l6 = this.f1655b;
                        if (l6.f1698k.a()) {
                            MutableIntState mutableIntState = l6.f1705s;
                            intValue = mutableIntState.getIntValue() != -1 ? mutableIntState.getIntValue() : Math.abs(l6.m()) >= Math.abs(Math.min(l6.f1703q.Y(P.f1716a), ((float) l6.p()) / 2.0f) / ((float) l6.p())) ? ((Boolean) l6.f1686I.getValue()).booleanValue() ? l6.f1692e + 1 : l6.f1692e : l6.l();
                        } else {
                            intValue = l6.l();
                        }
                        return Integer.valueOf(l6.k(intValue));
                    default:
                        return Integer.valueOf(this.f1655b.o());
                }
            }
        });
        F.Q q6 = new F.Q(new J4.c(this) { // from class: G.E

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ L f1653b;

            {
                this.f1653b = this;
            }

            /* JADX WARN: Multi-variable type inference failed */
            /* JADX WARN: Type inference failed for: r14v1, types: [java.lang.Float] */
            /* JADX WARN: Type inference failed for: r14v3, types: [java.lang.Number] */
            /* JADX WARN: Type inference failed for: r14v4, types: [java.lang.Long] */
            @Override // J4.c
            public final Object invoke(Object obj) {
                y yVar;
                switch (i9) {
                    case 0:
                        ?? ValueOf = (Float) obj;
                        float fFloatValue = ValueOf.floatValue();
                        L l = this.f1653b;
                        l.getClass();
                        long jU = e4.C.u(l);
                        float f7 = l.f1696i + fFloatValue;
                        long jE0 = L4.a.e0(f7);
                        l.f1696i = f7 - jE0;
                        if (Math.abs(fFloatValue) >= 1.0E-4f) {
                            long j4 = jU + jE0;
                            long jX = L4.a.x(j4, l.f1695h, l.f1694g);
                            boolean z6 = j4 != jX;
                            long j6 = jX - jU;
                            float f8 = j6;
                            l.f1697j = f8;
                            if (Math.abs(j6) != 0) {
                                l.f1686I.setValue(Boolean.valueOf(f8 > 0.0f));
                                l.f1687J.setValue(Boolean.valueOf(f8 < 0.0f));
                            }
                            int i82 = (int) j6;
                            int i92 = -i82;
                            y yVarA = ((y) l.f1702p.getValue()).a(i92);
                            if (yVarA != null && (yVar = l.f1689b) != null) {
                                y yVarA2 = yVar.a(i92);
                                if (yVarA2 != null) {
                                    l.f1689b = yVarA2;
                                } else {
                                    yVarA = null;
                                }
                            }
                            if (yVarA != null) {
                                l.h(yVarA, l.f1688a, true);
                                l.f1682E.setValue(C3137A.f25453a);
                            } else {
                                B b5 = l.f1691d;
                                float fQ = ((L) b5.f1645b).q() != 0 ? i82 / r6.q() : 0.0f;
                                MutableFloatState mutableFloatState = (MutableFloatState) b5.f1647d;
                                mutableFloatState.setFloatValue(mutableFloatState.getFloatValue() + fQ);
                                s0 s0Var = (s0) l.f1678A.getValue();
                                if (s0Var != null) {
                                    ((I0.H) s0Var).i();
                                }
                            }
                            if (z6) {
                                ValueOf = Long.valueOf(j6);
                            }
                            fFloatValue = ValueOf.floatValue();
                        }
                        return Float.valueOf(fFloatValue);
                    default:
                        L l6 = this.f1653b;
                        F.O o6 = (F.O) obj;
                        Snapshot.Companion companion = Snapshot.Companion;
                        Snapshot currentThreadSnapshot = companion.getCurrentThreadSnapshot();
                        J4.c readObserver = currentThreadSnapshot != null ? currentThreadSnapshot.getReadObserver() : null;
                        Snapshot snapshotMakeCurrentNonObservable = companion.makeCurrentNonObservable(currentThreadSnapshot);
                        try {
                            o6.a(l6.f1692e);
                            companion.restoreNonObservable(currentThreadSnapshot, snapshotMakeCurrentNonObservable, readObserver);
                            return C3137A.f25453a;
                        } catch (Throwable th) {
                            companion.restoreNonObservable(currentThreadSnapshot, snapshotMakeCurrentNonObservable, readObserver);
                            throw th;
                        }
                }
            }
        });
        this.f1709w = q6;
        final int i10 = 2;
        this.f1710x = new C0238m(new C0235j(), q6, new J4.a(this) { // from class: G.F

            /* JADX INFO: renamed from: b, reason: collision with root package name */
            public final /* synthetic */ L f1655b;

            {
                this.f1655b = this;
            }

            @Override // J4.a
            public final Object invoke() {
                int intValue;
                switch (i10) {
                    case 0:
                        L l = this.f1655b;
                        return Integer.valueOf(l.f1698k.a() ? l.f1706t.getIntValue() : l.l());
                    case 1:
                        L l6 = this.f1655b;
                        if (l6.f1698k.a()) {
                            MutableIntState mutableIntState = l6.f1705s;
                            intValue = mutableIntState.getIntValue() != -1 ? mutableIntState.getIntValue() : Math.abs(l6.m()) >= Math.abs(Math.min(l6.f1703q.Y(P.f1716a), ((float) l6.p()) / 2.0f) / ((float) l6.p())) ? ((Boolean) l6.f1686I.getValue()).booleanValue() ? l6.f1692e + 1 : l6.f1692e : l6.l();
                        } else {
                            intValue = l6.l();
                        }
                        return Integer.valueOf(l6.k(intValue));
                    default:
                        return Integer.valueOf(this.f1655b.o());
                }
            }
        });
        this.f1711y = new C0156j();
        this.f1712z = new C0150d();
        this.f1678A = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(null, null, 2, null);
        this.f1679B = new D.E(this, 2);
        this.f1680C = h1.b.b(0, 0, 15);
        this.f1681D = new F.N();
        this.f1682E = AbstractC0158l.k();
        this.f1683F = AbstractC0158l.k();
        Boolean bool = Boolean.FALSE;
        this.f1684G = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(bool, null, 2, null);
        this.f1685H = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(bool, null, 2, null);
        this.f1686I = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(bool, null, 2, null);
        this.f1687J = SnapshotStateKt__SnapshotStateKt.mutableStateOf$default(bool, null, 2, null);
    }

    public static /* synthetic */ Object g(L l, int i6, F0 f0, C4.j jVar, int i7) {
        InterfaceC2787m interfaceC2787mO = f0;
        if ((i7 & 4) != 0) {
            interfaceC2787mO = AbstractC2771e.o(0.0f, 0.0f, null, 7);
        }
        return l.f(i6, interfaceC2787mO, jVar);
    }

    /* JADX WARN: Type inference failed for: r0v0, types: [java.lang.Object, java.util.List] */
    public static int j(boolean z6, y yVar) {
        ?? r02 = yVar.f1822a;
        int i6 = yVar.f1829h;
        if (!z6) {
            return (((C0234i) AbstractC3251q.e0(r02)).f1756a - i6) - 1;
        }
        int i7 = i6 + 1;
        if (i7 < 0) {
            return Integer.MAX_VALUE;
        }
        return ((C0234i) AbstractC3251q.n0(r02)).f1756a + i7;
    }

    /* JADX WARN: Code restructure failed: missing block: B:23:0x0070, code lost:
    
        if (r5.f1698k.e(r6, r7, r0) == r1) goto L24;
     */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static Object u(L l, z0 z0Var, J4.e eVar, A4.d dVar) {
        J j4;
        if (dVar instanceof J) {
            j4 = (J) dVar;
            int i6 = j4.f1674f;
            if ((i6 & Integer.MIN_VALUE) != 0) {
                j4.f1674f = i6 - Integer.MIN_VALUE;
            } else {
                j4 = new J(l, dVar);
            }
        }
        Object obj = j4.f1672d;
        B4.a aVar = B4.a.f492a;
        int i7 = j4.f1674f;
        if (i7 == 0) {
            AbstractC2467b.l(obj);
            j4.f1669a = l;
            j4.f1670b = z0Var;
            j4.f1671c = eVar;
            j4.f1674f = 1;
            if (l.i(j4) != aVar) {
            }
            return aVar;
        }
        if (i7 != 1) {
            if (i7 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            l = j4.f1669a;
            AbstractC2467b.l(obj);
            l.f1705s.setIntValue(-1);
            return C3137A.f25453a;
        }
        eVar = j4.f1671c;
        z0Var = j4.f1670b;
        l = j4.f1669a;
        AbstractC2467b.l(obj);
        if (!l.f1698k.a()) {
            l.f1706t.setIntValue(l.l());
        }
        j4.f1669a = l;
        j4.f1670b = null;
        j4.f1671c = null;
        j4.f1674f = 2;
    }

    @Override // x.InterfaceC3146a1
    public final boolean a() {
        return this.f1698k.a();
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // x.InterfaceC3146a1
    public final boolean b() {
        return ((Boolean) this.f1685H.getValue()).booleanValue();
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // x.InterfaceC3146a1
    public final boolean c() {
        return ((Boolean) this.f1684G.getValue()).booleanValue();
    }

    @Override // x.InterfaceC3146a1
    public final float d(float f6) {
        return this.f1698k.d(f6);
    }

    @Override // x.InterfaceC3146a1
    public final Object e(z0 z0Var, J4.e eVar, A4.d dVar) {
        return u(this, z0Var, eVar, dVar);
    }

    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object f(int i6, InterfaceC2787m interfaceC2787m, C4.c cVar) {
        G g6;
        if (cVar instanceof G) {
            g6 = (G) cVar;
            int i7 = g6.f1660e;
            if ((i7 & Integer.MIN_VALUE) != 0) {
                g6.f1660e = i7 - Integer.MIN_VALUE;
            } else {
                g6 = new G(this, cVar);
            }
        }
        Object obj = g6.f1658c;
        Object obj2 = B4.a.f492a;
        int i8 = g6.f1660e;
        C3137A c3137a = C3137A.f25453a;
        if (i8 == 0) {
            AbstractC2467b.l(obj);
            if ((i6 != l() || m() != 0.0f) && o() != 0) {
                g6.f1657b = interfaceC2787m;
                g6.f1656a = i6;
                g6.f1660e = 1;
                if (i(g6) == obj2) {
                }
            }
        }
        if (i8 != 1) {
            if (i8 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AbstractC2467b.l(obj);
            return c3137a;
        }
        i6 = g6.f1656a;
        interfaceC2787m = g6.f1657b;
        AbstractC2467b.l(obj);
        InterfaceC2787m interfaceC2787m2 = interfaceC2787m;
        double d6 = 0.0f;
        if (-0.5d > d6 || d6 > 0.5d) {
            A.b.a("pageOffsetFraction 0.0 is not within the range -0.5 to 0.5");
        }
        J4.e h5 = new H(this, k(i6), 0.0f * q(), interfaceC2787m2, null);
        g6.f1657b = null;
        g6.f1660e = 2;
        return e(z0.f24987a, h5, g6) == obj2 ? obj2 : c3137a;
    }

    /* JADX WARN: Removed duplicated region for block: B:71:0x011e A[Catch: all -> 0x012a, TryCatch #0 {all -> 0x012a, blocks: (B:53:0x00bd, B:57:0x00cc, B:60:0x00d5, B:63:0x00e2, B:65:0x00ee, B:73:0x0124, B:71:0x011e, B:68:0x0106), top: B:89:0x00bd }] */
    /* JADX WARN: Type inference failed for: r0v0, types: [java.lang.Object, java.util.Collection, java.util.List] */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void h(y yVar, boolean z6, boolean z7) {
        ?? r02 = yVar.f1822a;
        this.f1709w.f1223e = r02.size();
        if (!z6 && this.f1688a) {
            this.f1689b = yVar;
            return;
        }
        boolean z8 = true;
        if (z6) {
            this.f1688a = true;
        }
        B b5 = this.f1691d;
        float f6 = yVar.f1832k;
        if (z7) {
            ((MutableFloatState) b5.f1647d).setFloatValue(f6);
        } else {
            b5.getClass();
            C0234i c0234i = yVar.f1831j;
            b5.f1648e = c0234i != null ? c0234i.f1759d : null;
            if (b5.f1644a || !r02.isEmpty()) {
                b5.f1644a = true;
                int i6 = c0234i != null ? c0234i.f1756a : 0;
                ((MutableIntState) b5.f1646c).setIntValue(i6);
                ((F.K) b5.f1649f).b(i6);
                ((MutableFloatState) b5.f1647d).setFloatValue(f6);
            }
            if (this.f1699m != -1 && !r02.isEmpty()) {
                if (this.f1699m != j(this.f1701o, yVar)) {
                    this.f1699m = -1;
                    F.P p6 = this.f1700n;
                    if (p6 != null) {
                        p6.cancel();
                    }
                    this.f1700n = null;
                }
            }
        }
        this.f1702p.setValue(yVar);
        this.f1684G.setValue(Boolean.valueOf(yVar.f1833m));
        C0234i c0234i2 = yVar.f1830i;
        int i7 = c0234i2 != null ? c0234i2.f1756a : 0;
        int i8 = yVar.l;
        if (i7 == 0 && i8 == 0) {
            z8 = false;
        }
        this.f1685H.setValue(Boolean.valueOf(z8));
        if (c0234i2 != null) {
            this.f1692e = c0234i2.f1756a;
        }
        this.f1693f = i8;
        Snapshot.Companion companion = Snapshot.Companion;
        Snapshot currentThreadSnapshot = companion.getCurrentThreadSnapshot();
        J4.c readObserver = currentThreadSnapshot != null ? currentThreadSnapshot.getReadObserver() : null;
        Snapshot snapshotMakeCurrentNonObservable = companion.makeCurrentNonObservable(currentThreadSnapshot);
        try {
            if (this.l && yVar.f1829h < o() && Math.abs(this.f1697j) > 0.5f) {
                float f7 = this.f1697j;
                if (n().f1826e == EnumC3207z0.f25984a) {
                    if (Math.signum(f7) != Math.signum(-Float.intBitsToFloat((int) (r() & 4294967295L)))) {
                        if (s()) {
                        }
                    }
                    t(this.f1697j, yVar);
                } else {
                    if (Math.signum(f7) == Math.signum(-Float.intBitsToFloat((int) (r() >> 32)))) {
                    }
                    t(this.f1697j, yVar);
                }
            }
            this.f1694g = P.a(yVar, o());
            o();
            int iE = (int) (yVar.f1826e == EnumC3207z0.f25985b ? yVar.e() >> 32 : yVar.e() & 4294967295L);
            yVar.f1834n.getClass();
            long jV = L4.a.v(0, 0, iE);
            long j4 = this.f1694g;
            if (jV > j4) {
                jV = j4;
            }
            this.f1695h = jV;
        } finally {
            companion.restoreNonObservable(currentThreadSnapshot, snapshotMakeCurrentNonObservable, readObserver);
        }
    }

    public final Object i(C4.c cVar) {
        Object objD;
        return (this.f1702p.getValue() == P.f1718c && (objD = this.f1712z.d(cVar)) == B4.a.f492a) ? objD : C3137A.f25453a;
    }

    public final int k(int i6) {
        if (o() > 0) {
            return L4.a.v(i6, 0, o() - 1);
        }
        return 0;
    }

    public final int l() {
        return ((MutableIntState) this.f1691d.f1646c).getIntValue();
    }

    public final float m() {
        return ((MutableFloatState) this.f1691d.f1647d).getFloatValue();
    }

    public final y n() {
        return (y) this.f1702p.getValue();
    }

    public abstract int o();

    public final int p() {
        return ((y) this.f1702p.getValue()).f1823b;
    }

    public final int q() {
        return ((y) this.f1702p.getValue()).f1824c + p();
    }

    /* JADX WARN: Multi-variable type inference failed */
    public final long r() {
        return ((C2631b) this.f1690c.getValue()).f21785a;
    }

    public final boolean s() {
        return ((int) Float.intBitsToFloat((int) (r() >> 32))) == 0 && ((int) Float.intBitsToFloat((int) (r() & 4294967295L))) == 0;
    }

    /* JADX WARN: Type inference failed for: r0v1, types: [java.lang.Object, java.util.Collection, java.util.List] */
    public final void t(float f6, y yVar) {
        F.P p6;
        F.P p7;
        F.P p8;
        if (this.l) {
            if (yVar.f1822a.isEmpty()) {
                return;
            }
            boolean z6 = f6 > 0.0f;
            int iJ = j(z6, yVar);
            if (iJ < 0 || iJ >= o()) {
                return;
            }
            if (iJ != this.f1699m) {
                if (this.f1701o != z6 && (p8 = this.f1700n) != null) {
                    p8.cancel();
                }
                this.f1701o = z6;
                this.f1699m = iJ;
                this.f1700n = this.f1709w.a(iJ, this.f1680C, true, null);
            }
            if (z6) {
                if ((((C0234i) AbstractC3251q.n0(r0)).f1765j + (yVar.f1823b + yVar.f1824c)) - yVar.f1828g >= f6 || (p7 = this.f1700n) == null) {
                    return;
                }
                p7.a();
                return;
            }
            if (yVar.f1827f - ((C0234i) AbstractC3251q.e0(r0)).f1765j >= (-f6) || (p6 = this.f1700n) == null) {
                return;
            }
            p6.a();
        }
    }

    public final void v(float f6, int i6, boolean z6) {
        B b5 = this.f1691d;
        int intValue = ((MutableIntState) b5.f1646c).getIntValue();
        MutableFloatState mutableFloatState = (MutableFloatState) b5.f1647d;
        if (intValue != i6 || mutableFloatState.getFloatValue() != f6) {
            this.f1710x.b();
        }
        ((MutableIntState) b5.f1646c).setIntValue(i6);
        ((F.K) b5.f1649f).b(i6);
        mutableFloatState.setFloatValue(f6);
        b5.f1648e = null;
        if (!z6) {
            this.f1683F.setValue(C3137A.f25453a);
        } else {
            s0 s0Var = (s0) this.f1678A.getValue();
            if (s0Var != null) {
                ((I0.H) s0Var).i();
            }
        }
    }
}
