package com.vinfast.companion.corecompose.effect;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.dex */
@androidx.compose.runtime.internal.StabilityInferred
@kotlin.Metadata(d1 = {"\u0000X\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0010\u0007\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0003\b\u0007\u0018\u00002\u00020\u0001J3\u0010\b\u001a\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00042\u0012\u0010\u0007\u001a\u000e\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u00020\u0006H\u0016¢\u0006\u0004\b\b\u0010\tJ<\u0010\u0011\u001a\u00020\u00102\u0006\u0010\u000b\u001a\u00020\n2\"\u0010\u000f\u001a\u001e\b\u0001\u0012\u0004\u0012\u00020\n\u0012\n\u0012\b\u0012\u0004\u0012\u00020\n0\r\u0012\u0006\u0012\u0004\u0018\u00010\u000e0\fH\u0096@¢\u0006\u0004\b\u0011\u0010\u0012R\u0014\u0010\u0016\u001a\u00020\u00138\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0014\u0010\u0015R \u0010\u001b\u001a\u000e\u0012\u0004\u0012\u00020\u0018\u0012\u0004\u0012\u00020\u00190\u00178\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\b\u0010\u001aR\u0014\u0010\u001e\u001a\u00020\u001c8VX\u0096\u0004¢\u0006\u0006\u001a\u0004\b\u0014\u0010\u001d¨\u0006\u001f"}, d2 = {"Lcom/vinfast/companion/corecompose/effect/OffsetOverscrollEffect;", "Landroidx/compose/foundation/OverscrollEffect;", "Landroidx/compose/ui/geometry/Offset;", "delta", "Landroidx/compose/ui/input/nestedscroll/NestedScrollSource;", "source", "Lkotlin/Function1;", "performScroll", "b", "(JILkotlin/jvm/functions/Function1;)J", "Landroidx/compose/ui/unit/Velocity;", "velocity", "Lkotlin/Function2;", "Lkotlin/coroutines/Continuation;", "", "performFling", "", "c", "(JLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "Lkotlinx/coroutines/CoroutineScope;", "a", "Lkotlinx/coroutines/CoroutineScope;", "scope", "Landroidx/compose/animation/core/Animatable;", "", "Landroidx/compose/animation/core/AnimationVector1D;", "Landroidx/compose/animation/core/Animatable;", "overscrollOffset", "", "()Z", "isInProgress", "core-compose_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
@kotlin.jvm.internal.SourceDebugExtension
public final class OffsetOverscrollEffect implements androidx.compose.foundation.OverscrollEffect {

    /* JADX INFO: renamed from: a, reason: from kotlin metadata */
    private final kotlinx.coroutines.CoroutineScope scope;

    /* JADX INFO: renamed from: b, reason: from kotlin metadata */
    private final androidx.compose.animation.core.Animatable overscrollOffset;

    public boolean a() {
        return !(((java.lang.Number) this.overscrollOffset.n()).floatValue() == 0.0f);
    }

    public long b(long delta, int source, kotlin.jvm.functions.Function1 performScroll) {
        long jC;
        kotlin.jvm.internal.Intrinsics.l(performScroll, "performScroll");
        int i = (int) (delta & 4294967295L);
        boolean z = java.lang.Math.signum(java.lang.Float.intBitsToFloat(i)) == java.lang.Math.signum(((java.lang.Number) this.overscrollOffset.n()).floatValue());
        if (java.lang.Math.abs(((java.lang.Number) this.overscrollOffset.n()).floatValue()) <= 0.5d || z) {
            jC = androidx.compose.ui.geometry.Offset.b.c();
        } else {
            float fFloatValue = ((java.lang.Number) this.overscrollOffset.n()).floatValue();
            if (java.lang.Math.signum(fFloatValue) == java.lang.Math.signum(((java.lang.Number) this.overscrollOffset.n()).floatValue() + java.lang.Float.intBitsToFloat(i))) {
                kotlinx.coroutines.BuildersKt.d(this.scope, (kotlin.coroutines.CoroutineContext) null, (kotlinx.coroutines.CoroutineStart) null, new com.vinfast.companion.corecompose.effect.OffsetOverscrollEffect$applyToScroll$consumedByPreScroll$2(this, delta, null), 3, (java.lang.Object) null);
                jC = androidx.compose.ui.geometry.Offset.g(delta, 0.0f, 0.0f, 2, (java.lang.Object) null);
            } else {
                kotlinx.coroutines.BuildersKt.d(this.scope, (kotlin.coroutines.CoroutineContext) null, (kotlinx.coroutines.CoroutineStart) null, new com.vinfast.companion.corecompose.effect.OffsetOverscrollEffect$applyToScroll$consumedByPreScroll$1(this, null), 3, (java.lang.Object) null);
                jC = androidx.compose.ui.geometry.Offset.e((((long) java.lang.Float.floatToRawIntBits(0.0f)) << 32) | (((long) java.lang.Float.floatToRawIntBits(java.lang.Float.intBitsToFloat(i) + fFloatValue)) & 4294967295L));
            }
        }
        long jP = androidx.compose.ui.geometry.Offset.p(delta, jC);
        long jT = ((androidx.compose.ui.geometry.Offset) performScroll.invoke(androidx.compose.ui.geometry.Offset.d(jP))).t();
        long jP2 = androidx.compose.ui.geometry.Offset.p(jP, jT);
        if (java.lang.Math.abs(java.lang.Float.intBitsToFloat((int) (jP2 & 4294967295L))) > 0.5d && androidx.compose.ui.input.nestedscroll.NestedScrollSource.f(source, androidx.compose.ui.input.nestedscroll.NestedScrollSource.b.a())) {
            kotlinx.coroutines.BuildersKt.d(this.scope, (kotlin.coroutines.CoroutineContext) null, (kotlinx.coroutines.CoroutineStart) null, new com.vinfast.companion.corecompose.effect.OffsetOverscrollEffect$applyToScroll$1(this, jP2, null), 3, (java.lang.Object) null);
        }
        return androidx.compose.ui.geometry.Offset.q(jC, jT);
    }

    /* JADX WARN: Code duplicated, block: B:8:0x0014  */
    /* JADX WARN: Code restructure failed: missing block: B:21:0x009b, code lost:
    
        if (androidx.compose.animation.core.Animatable.f(r11, r8, r7, r15, (kotlin.jvm.functions.Function1) null, r6, 8, (java.lang.Object) null) == r0) goto L22;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public java.lang.Object c(long r12, kotlin.jvm.functions.Function2 r14, kotlin.coroutines.Continuation r15) {
        /*
            r11 = this;
            boolean r0 = r15 instanceof com.vinfast.companion.corecompose.effect.OffsetOverscrollEffect$applyToFling$1
            if (r0 == 0) goto L14
            r0 = r15
            com.vinfast.companion.corecompose.effect.OffsetOverscrollEffect$applyToFling$1 r0 = (com.vinfast.companion.corecompose.effect.OffsetOverscrollEffect$applyToFling$1) r0
            int r1 = r0.t
            r2 = -2147483648(0xffffffff80000000, float:-0.0)
            r3 = r1 & r2
            if (r3 == 0) goto L14
            int r1 = r1 - r2
            r0.t = r1
        L12:
            r6 = r0
            goto L1a
        L14:
            com.vinfast.companion.corecompose.effect.OffsetOverscrollEffect$applyToFling$1 r0 = new com.vinfast.companion.corecompose.effect.OffsetOverscrollEffect$applyToFling$1
            r0.<init>(r11, r15)
            goto L12
        L1a:
            java.lang.Object r15 = r6.r
            java.lang.Object r0 = kotlin.coroutines.intrinsics.IntrinsicsKt.g()
            int r1 = r6.t
            r2 = 1
            r3 = 2
            if (r1 == 0) goto L44
            if (r1 == r2) goto L3a
            if (r1 != r3) goto L32
            java.lang.Object r11 = r6.q
            kotlin.jvm.functions.Function2 r11 = (kotlin.jvm.functions.Function2) r11
            kotlin.ResultKt.b(r15)
            goto L9e
        L32:
            java.lang.IllegalStateException r11 = new java.lang.IllegalStateException
            java.lang.String r12 = "call to 'resume' before 'invoke' with coroutine"
            r11.<init>(r12)
            throw r11
        L3a:
            long r12 = r6.n
            java.lang.Object r14 = r6.q
            kotlin.jvm.functions.Function2 r14 = (kotlin.jvm.functions.Function2) r14
            kotlin.ResultKt.b(r15)
            goto L5c
        L44:
            kotlin.ResultKt.b(r15)
            androidx.compose.ui.unit.Velocity r15 = androidx.compose.ui.unit.Velocity.b(r12)
            java.lang.Object r1 = kotlin.coroutines.jvm.internal.SpillingKt.a(r14)
            r6.q = r1
            r6.n = r12
            r6.t = r2
            java.lang.Object r15 = r14.invoke(r15, r6)
            if (r15 != r0) goto L5c
            goto L9d
        L5c:
            androidx.compose.ui.unit.Velocity r15 = (androidx.compose.ui.unit.Velocity) r15
            long r1 = r15.o()
            long r4 = androidx.compose.ui.unit.Velocity.k(r12, r1)
            androidx.compose.animation.core.Animatable r11 = r11.overscrollOffset
            float r15 = androidx.compose.ui.unit.Velocity.i(r4)
            androidx.compose.animation.core.Easing r7 = androidx.compose.animation.core.EasingFunctionsKt.m()
            r8 = 0
            r9 = 500(0x1f4, float:7.0E-43)
            r10 = 0
            androidx.compose.animation.core.TweenSpec r7 = androidx.compose.animation.core.AnimationSpecKt.n(r9, r10, r7, r3, r8)
            r8 = 0
            java.lang.Float r8 = kotlin.coroutines.jvm.internal.Boxing.c(r8)
            java.lang.Float r15 = kotlin.coroutines.jvm.internal.Boxing.c(r15)
            java.lang.Object r14 = kotlin.coroutines.jvm.internal.SpillingKt.a(r14)
            r6.q = r14
            r6.n = r12
            r6.o = r1
            r6.p = r4
            r6.t = r3
            r5 = 0
            r3 = r7
            r7 = 8
            r2 = r8
            r8 = 0
            r1 = r11
            r4 = r15
            java.lang.Object r11 = androidx.compose.animation.core.Animatable.f(r1, r2, r3, r4, r5, r6, r7, r8)
            if (r11 != r0) goto L9e
        L9d:
            return r0
        L9e:
            kotlin.Unit r11 = kotlin.Unit.a
            return r11
        */
        throw new UnsupportedOperationException("Method not decompiled: com.vinfast.companion.corecompose.effect.OffsetOverscrollEffect.c(long, kotlin.jvm.functions.Function2, kotlin.coroutines.Continuation):java.lang.Object");
    }

    public /* bridge */ androidx.compose.ui.node.DelegatableNode getNode() {
        return super.getNode();
    }
}
