package androidx.compose.foundation.gestures;

import b0.n;
import b0.q;
import b0.u;
import b0.x;
import b0.z;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import d2.m0;
import d2.y;
import dn.l;
import dn.p;
import kotlin.jvm.internal.l0;
import kotlin.jvm.internal.v;
import l1.i;
import l1.l;
import rm.n0;
import vm.g;
import y.k1;
import z.g0;

/* loaded from: classes.dex */
public abstract class d {

    /* renamed from: a, reason: collision with root package name */
    private static final l f1685a = a.f1689p;

    /* renamed from: b, reason: collision with root package name */
    private static final u f1686b = new c();

    /* renamed from: c, reason: collision with root package name */
    private static final l1.l f1687c = new b();

    /* renamed from: d, reason: collision with root package name */
    private static final C0046d f1688d = new C0046d();

    /* loaded from: classes.dex */
    static final class a extends v implements l {

        /* renamed from: p, reason: collision with root package name */
        public static final a f1689p = new a();

        a() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Boolean invoke(y yVar) {
            return Boolean.valueOf(!m0.g(yVar.n(), m0.f15832a.b()));
        }
    }

    /* loaded from: classes.dex */
    public static final class b implements l1.l {
        b() {
        }

        @Override // vm.g.b, vm.g
        public g.b d(g.c cVar) {
            return l.a.b(this, cVar);
        }

        @Override // vm.g
        public g h(g gVar) {
            return l.a.d(this, gVar);
        }

        @Override // vm.g
        public g r(g.c cVar) {
            return l.a.c(this, cVar);
        }

        @Override // l1.l
        public float w() {
            return 1.0f;
        }

        @Override // vm.g
        public Object y(Object obj, p pVar) {
            return l.a.a(this, obj, pVar);
        }
    }

    /* loaded from: classes.dex */
    public static final class c implements u {
        c() {
        }

        @Override // b0.u
        public float a(float f10) {
            return f10;
        }
    }

    /* renamed from: androidx.compose.foundation.gestures.d$d, reason: collision with other inner class name */
    /* loaded from: classes.dex */
    public static final class C0046d implements c3.d {
        C0046d() {
        }

        @Override // c3.l
        public float G0() {
            return 1.0f;
        }

        @Override // c3.d
        public float getDensity() {
            return 1.0f;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class e extends kotlin.coroutines.jvm.internal.d {

        /* renamed from: p, reason: collision with root package name */
        Object f1690p;

        /* renamed from: q, reason: collision with root package name */
        Object f1691q;

        /* renamed from: r, reason: collision with root package name */
        /* synthetic */ Object f1692r;

        /* renamed from: s, reason: collision with root package name */
        int f1693s;

        e(vm.d dVar) {
            super(dVar);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            this.f1692r = obj;
            this.f1693s |= Integer.MIN_VALUE;
            return d.j(null, 0L, this);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class f extends kotlin.coroutines.jvm.internal.l implements p {

        /* renamed from: p, reason: collision with root package name */
        int f1694p;

        /* renamed from: q, reason: collision with root package name */
        private /* synthetic */ Object f1695q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ z f1696r;

        /* renamed from: s, reason: collision with root package name */
        final /* synthetic */ long f1697s;

        /* renamed from: t, reason: collision with root package name */
        final /* synthetic */ l0 f1698t;

        /* JADX INFO: Access modifiers changed from: package-private */
        /* loaded from: classes.dex */
        public static final class a extends v implements p {

            /* renamed from: p, reason: collision with root package name */
            final /* synthetic */ l0 f1699p;

            /* renamed from: q, reason: collision with root package name */
            final /* synthetic */ z f1700q;

            /* renamed from: r, reason: collision with root package name */
            final /* synthetic */ b0.p f1701r;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            a(l0 l0Var, z zVar, b0.p pVar) {
                super(2);
                this.f1699p = l0Var;
                this.f1700q = zVar;
                this.f1701r = pVar;
            }

            public final void a(float f10, float f11) {
                float f12 = f10 - this.f1699p.f26195p;
                z zVar = this.f1700q;
                this.f1699p.f26195p += zVar.t(zVar.A(this.f1701r.b(zVar.B(zVar.t(f12)), c2.e.f7396a.b())));
            }

            @Override // dn.p
            public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
                a(((Number) obj).floatValue(), ((Number) obj2).floatValue());
                return n0.f34904a;
            }
        }

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        f(z zVar, long j10, l0 l0Var, vm.d dVar) {
            super(2, dVar);
            this.f1696r = zVar;
            this.f1697s = j10;
            this.f1698t = l0Var;
        }

        @Override // dn.p
        /* renamed from: b, reason: merged with bridge method [inline-methods] */
        public final Object invoke(b0.p pVar, vm.d dVar) {
            return ((f) create(pVar, dVar)).invokeSuspend(n0.f34904a);
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final vm.d create(Object obj, vm.d dVar) {
            f fVar = new f(this.f1696r, this.f1697s, this.f1698t, dVar);
            fVar.f1695q = obj;
            return fVar;
        }

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            Object f10;
            f10 = wm.d.f();
            int i10 = this.f1694p;
            if (i10 == 0) {
                rm.y.b(obj);
                b0.p pVar = (b0.p) this.f1695q;
                float A = this.f1696r.A(this.f1697s);
                a aVar = new a(this.f1698t, this.f1696r, pVar);
                this.f1694p = 1;
                if (k1.e(BitmapDescriptorFactory.HUE_RED, A, BitmapDescriptorFactory.HUE_RED, null, aVar, this, 12, null) == f10) {
                    return f10;
                }
            } else {
                if (i10 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                rm.y.b(obj);
            }
            return n0.f34904a;
        }
    }

    public static final l1.l e() {
        return f1687c;
    }

    public static final i f(i iVar, x xVar, q qVar, z.n0 n0Var, boolean z10, boolean z11, n nVar, d0.l lVar, b0.d dVar) {
        return iVar.f(new ScrollableElement(xVar, qVar, n0Var, z10, z11, nVar, lVar, dVar));
    }

    public static final i g(i iVar, x xVar, q qVar, boolean z10, boolean z11, n nVar, d0.l lVar) {
        return h(iVar, xVar, qVar, null, z10, z11, nVar, lVar, null, 128, null);
    }

    public static /* synthetic */ i h(i iVar, x xVar, q qVar, z.n0 n0Var, boolean z10, boolean z11, n nVar, d0.l lVar, b0.d dVar, int i10, Object obj) {
        return f(iVar, xVar, qVar, n0Var, (i10 & 8) != 0 ? true : z10, (i10 & 16) != 0 ? false : z11, (i10 & 32) != 0 ? null : nVar, (i10 & 64) != 0 ? null : lVar, (i10 & 128) != 0 ? null : dVar);
    }

    public static /* synthetic */ i i(i iVar, x xVar, q qVar, boolean z10, boolean z11, n nVar, d0.l lVar, int i10, Object obj) {
        if ((i10 & 4) != 0) {
            z10 = true;
        }
        boolean z12 = z10;
        if ((i10 & 8) != 0) {
            z11 = false;
        }
        return g(iVar, xVar, qVar, z12, z11, (i10 & 16) != 0 ? null : nVar, (i10 & 32) != 0 ? null : lVar);
    }

    /* JADX INFO: Access modifiers changed from: private */
    /* JADX WARN: Removed duplicated region for block: B:15:0x003b  */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0023  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final Object j(z zVar, long j10, vm.d dVar) {
        e eVar;
        Object f10;
        int i10;
        l0 l0Var;
        if (dVar instanceof e) {
            eVar = (e) dVar;
            int i11 = eVar.f1693s;
            if ((i11 & Integer.MIN_VALUE) != 0) {
                eVar.f1693s = i11 - Integer.MIN_VALUE;
                Object obj = eVar.f1692r;
                f10 = wm.d.f();
                i10 = eVar.f1693s;
                if (i10 != 0) {
                    rm.y.b(obj);
                    l0Var = new l0();
                    g0 g0Var = g0.Default;
                    f fVar = new f(zVar, j10, l0Var, null);
                    eVar.f1690p = zVar;
                    eVar.f1691q = l0Var;
                    eVar.f1693s = 1;
                    if (zVar.v(g0Var, fVar, eVar) == f10) {
                        return f10;
                    }
                } else {
                    if (i10 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    l0 l0Var2 = (l0) eVar.f1691q;
                    z zVar2 = (z) eVar.f1690p;
                    rm.y.b(obj);
                    l0Var = l0Var2;
                    zVar = zVar2;
                }
                return r1.g.d(zVar.B(l0Var.f26195p));
            }
        }
        eVar = new e(dVar);
        Object obj2 = eVar.f1692r;
        f10 = wm.d.f();
        i10 = eVar.f1693s;
        if (i10 != 0) {
        }
        return r1.g.d(zVar.B(l0Var.f26195p));
    }
}
