package u0;

import android.view.ViewGroup;
import d0.n;
import rm.n0;
import s1.a0;
import s1.g0;
import tp.m0;
import y0.q1;
import y0.s2;
import y0.s3;
import y0.y3;

/* loaded from: classes.dex */
public final class a extends o implements s2, k {
    private int A;
    private final dn.a B;

    /* renamed from: r, reason: collision with root package name */
    private final boolean f36641r;

    /* renamed from: s, reason: collision with root package name */
    private final float f36642s;

    /* renamed from: t, reason: collision with root package name */
    private final y3 f36643t;

    /* renamed from: u, reason: collision with root package name */
    private final y3 f36644u;

    /* renamed from: v, reason: collision with root package name */
    private final ViewGroup f36645v;

    /* renamed from: w, reason: collision with root package name */
    private j f36646w;

    /* renamed from: x, reason: collision with root package name */
    private final q1 f36647x;

    /* renamed from: y, reason: collision with root package name */
    private final q1 f36648y;

    /* renamed from: z, reason: collision with root package name */
    private long f36649z;

    /* renamed from: u0.a$a, reason: collision with other inner class name */
    /* loaded from: classes.dex */
    static final class C0869a extends kotlin.jvm.internal.v implements dn.a {
        C0869a() {
            super(0);
        }

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

        /* renamed from: invoke, reason: collision with other method in class */
        public final void m432invoke() {
            a.this.o(!r1.l());
        }
    }

    public /* synthetic */ a(boolean z10, float f10, y3 y3Var, y3 y3Var2, ViewGroup viewGroup, kotlin.jvm.internal.k kVar) {
        this(z10, f10, y3Var, y3Var2, viewGroup);
    }

    private final void k() {
        j jVar = this.f36646w;
        if (jVar != null) {
            jVar.a(this);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final boolean l() {
        return ((Boolean) this.f36648y.getValue()).booleanValue();
    }

    private final j m() {
        j c10;
        j jVar = this.f36646w;
        if (jVar != null) {
            kotlin.jvm.internal.t.d(jVar);
            return jVar;
        }
        c10 = t.c(this.f36645v);
        this.f36646w = c10;
        kotlin.jvm.internal.t.d(c10);
        return c10;
    }

    private final n n() {
        return (n) this.f36647x.getValue();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void o(boolean z10) {
        this.f36648y.setValue(Boolean.valueOf(z10));
    }

    private final void p(n nVar) {
        this.f36647x.setValue(nVar);
    }

    @Override // z.c0
    public void a(u1.c cVar) {
        this.f36649z = cVar.b();
        this.A = Float.isNaN(this.f36642s) ? fn.c.c(i.a(cVar, this.f36641r, cVar.b())) : cVar.Z0(this.f36642s);
        long v10 = ((g0) this.f36643t.getValue()).v();
        float d10 = ((g) this.f36644u.getValue()).d();
        cVar.z1();
        f(cVar, this.f36642s, v10);
        a0 i10 = cVar.Q0().i();
        l();
        n n10 = n();
        if (n10 != null) {
            n10.f(cVar.b(), v10, d10);
            n10.draw(s1.c.d(i10));
        }
    }

    @Override // y0.s2
    public void b() {
        k();
    }

    @Override // y0.s2
    public void c() {
        k();
    }

    @Override // y0.s2
    public void d() {
    }

    @Override // u0.o
    public void e(n.b bVar, m0 m0Var) {
        n b10 = m().b(this);
        b10.b(bVar, this.f36641r, this.f36649z, this.A, ((g0) this.f36643t.getValue()).v(), ((g) this.f36644u.getValue()).d(), this.B);
        p(b10);
    }

    @Override // u0.o
    public void g(n.b bVar) {
        n n10 = n();
        if (n10 != null) {
            n10.e();
        }
    }

    @Override // u0.k
    public void s0() {
        p(null);
    }

    private a(boolean z10, float f10, y3 y3Var, y3 y3Var2, ViewGroup viewGroup) {
        super(z10, y3Var2);
        q1 d10;
        q1 d11;
        this.f36641r = z10;
        this.f36642s = f10;
        this.f36643t = y3Var;
        this.f36644u = y3Var2;
        this.f36645v = viewGroup;
        d10 = s3.d(null, null, 2, null);
        this.f36647x = d10;
        d11 = s3.d(Boolean.TRUE, null, 2, null);
        this.f36648y = d11;
        this.f36649z = r1.m.f34339b.b();
        this.A = -1;
        this.B = new C0869a();
    }
}
