package androidx.compose.foundation;

import c3.t;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import j2.e1;
import j2.f1;
import j2.r;
import j2.s;
import kotlin.jvm.internal.o0;
import kotlin.jvm.internal.v;
import l1.i;
import rm.n0;
import s1.b1;
import s1.c1;
import s1.g0;
import s1.l1;
import s1.r1;
import s1.y;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: classes.dex */
public final class c extends i.c implements r, e1 {
    private long C;
    private y D;
    private float E;
    private r1 F;
    private long G;
    private t H;
    private b1 I;
    private r1 J;

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

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

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

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ u1.c f1558r;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(o0 o0Var, c cVar, u1.c cVar2) {
            super(0);
            this.f1556p = o0Var;
            this.f1557q = cVar;
            this.f1558r = cVar2;
        }

        @Override // dn.a
        public /* bridge */ /* synthetic */ Object invoke() {
            m7invoke();
            return n0.f34904a;
        }

        /* renamed from: invoke, reason: collision with other method in class */
        public final void m7invoke() {
            this.f1556p.f26199p = this.f1557q.k2().a(this.f1558r.b(), this.f1558r.getLayoutDirection(), this.f1558r);
        }
    }

    public /* synthetic */ c(long j10, y yVar, float f10, r1 r1Var, kotlin.jvm.internal.k kVar) {
        this(j10, yVar, f10, r1Var);
    }

    private final void h2(u1.c cVar) {
        b1 j22 = j2(cVar);
        if (!g0.n(this.C, g0.f35254b.f())) {
            c1.d(cVar, j22, this.C, BitmapDescriptorFactory.HUE_RED, null, null, 0, 60, null);
        }
        y yVar = this.D;
        if (yVar != null) {
            c1.b(cVar, j22, yVar, this.E, null, null, 0, 56, null);
        }
    }

    private final void i2(u1.c cVar) {
        if (!g0.n(this.C, g0.f35254b.f())) {
            u1.f.Y0(cVar, this.C, 0L, 0L, BitmapDescriptorFactory.HUE_RED, null, null, 0, 126, null);
        }
        y yVar = this.D;
        if (yVar != null) {
            u1.f.y1(cVar, yVar, 0L, 0L, this.E, null, null, 0, 118, null);
        }
    }

    private final b1 j2(u1.c cVar) {
        o0 o0Var = new o0();
        if (r1.m.f(cVar.b(), this.G) && cVar.getLayoutDirection() == this.H && kotlin.jvm.internal.t.b(this.J, this.F)) {
            b1 b1Var = this.I;
            kotlin.jvm.internal.t.d(b1Var);
            o0Var.f26199p = b1Var;
        } else {
            f1.a(this, new a(o0Var, this, cVar));
        }
        this.I = (b1) o0Var.f26199p;
        this.G = cVar.b();
        this.H = cVar.getLayoutDirection();
        this.J = this.F;
        Object obj = o0Var.f26199p;
        kotlin.jvm.internal.t.d(obj);
        return (b1) obj;
    }

    public final void U0(r1 r1Var) {
        this.F = r1Var;
    }

    @Override // j2.e1
    public void V0() {
        this.G = r1.m.f34339b.a();
        this.H = null;
        this.I = null;
        this.J = null;
        s.a(this);
    }

    public final void a(float f10) {
        this.E = f10;
    }

    public final r1 k2() {
        return this.F;
    }

    public final void l2(y yVar) {
        this.D = yVar;
    }

    public final void m2(long j10) {
        this.C = j10;
    }

    @Override // j2.r
    public void r(u1.c cVar) {
        if (this.F == l1.a()) {
            i2(cVar);
        } else {
            h2(cVar);
        }
        cVar.z1();
    }

    private c(long j10, y yVar, float f10, r1 r1Var) {
        this.C = j10;
        this.D = yVar;
        this.E = f10;
        this.F = r1Var;
        this.G = r1.m.f34339b.a();
    }
}
