package w2;

import java.util.ArrayList;
import java.util.List;

/* loaded from: classes.dex */
public final class q0 {

    /* renamed from: d, reason: collision with root package name */
    public static final c f40799d = new c(null);

    /* renamed from: e, reason: collision with root package name */
    private static final i1.j f40800e = i1.k.a(a.f40804p, b.f40805p);

    /* renamed from: a, reason: collision with root package name */
    private final q2.d f40801a;

    /* renamed from: b, reason: collision with root package name */
    private final long f40802b;

    /* renamed from: c, reason: collision with root package name */
    private final q2.m0 f40803c;

    /* loaded from: classes.dex */
    static final class a extends kotlin.jvm.internal.v implements dn.p {

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

        a() {
            super(2);
        }

        @Override // dn.p
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final Object invoke(i1.l lVar, q0 q0Var) {
            ArrayList g10;
            g10 = sm.u.g(q2.a0.y(q0Var.e(), q2.a0.h(), lVar), q2.a0.y(q2.m0.b(q0Var.g()), q2.a0.o(q2.m0.f33348b), lVar));
            return g10;
        }
    }

    /* loaded from: classes.dex */
    static final class b extends kotlin.jvm.internal.v implements dn.l {

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

        b() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final q0 invoke(Object obj) {
            kotlin.jvm.internal.t.e(obj, "null cannot be cast to non-null type kotlin.collections.List<kotlin.Any>");
            List list = (List) obj;
            Object obj2 = list.get(0);
            i1.j h10 = q2.a0.h();
            Boolean bool = Boolean.FALSE;
            q2.m0 m0Var = null;
            q2.d dVar = ((!kotlin.jvm.internal.t.b(obj2, bool) || (h10 instanceof q2.n)) && obj2 != null) ? (q2.d) h10.a(obj2) : null;
            kotlin.jvm.internal.t.d(dVar);
            Object obj3 = list.get(1);
            i1.j o10 = q2.a0.o(q2.m0.f33348b);
            if ((!kotlin.jvm.internal.t.b(obj3, bool) || (o10 instanceof q2.n)) && obj3 != null) {
                m0Var = (q2.m0) o10.a(obj3);
            }
            kotlin.jvm.internal.t.d(m0Var);
            return new q0(dVar, m0Var.r(), (q2.m0) null, 4, (kotlin.jvm.internal.k) null);
        }
    }

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

        public /* synthetic */ c(kotlin.jvm.internal.k kVar) {
            this();
        }
    }

    public /* synthetic */ q0(String str, long j10, q2.m0 m0Var, kotlin.jvm.internal.k kVar) {
        this(str, j10, m0Var);
    }

    public static /* synthetic */ q0 c(q0 q0Var, String str, long j10, q2.m0 m0Var, int i10, Object obj) {
        if ((i10 & 2) != 0) {
            j10 = q0Var.f40802b;
        }
        if ((i10 & 4) != 0) {
            m0Var = q0Var.f40803c;
        }
        return q0Var.a(str, j10, m0Var);
    }

    public static /* synthetic */ q0 d(q0 q0Var, q2.d dVar, long j10, q2.m0 m0Var, int i10, Object obj) {
        if ((i10 & 1) != 0) {
            dVar = q0Var.f40801a;
        }
        if ((i10 & 2) != 0) {
            j10 = q0Var.f40802b;
        }
        if ((i10 & 4) != 0) {
            m0Var = q0Var.f40803c;
        }
        return q0Var.b(dVar, j10, m0Var);
    }

    public final q0 a(String str, long j10, q2.m0 m0Var) {
        kotlin.jvm.internal.k kVar = null;
        return new q0(new q2.d(str, null, null, 6, kVar), j10, m0Var, kVar);
    }

    public final q0 b(q2.d dVar, long j10, q2.m0 m0Var) {
        return new q0(dVar, j10, m0Var, (kotlin.jvm.internal.k) null);
    }

    public final q2.d e() {
        return this.f40801a;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof q0)) {
            return false;
        }
        q0 q0Var = (q0) obj;
        return q2.m0.g(this.f40802b, q0Var.f40802b) && kotlin.jvm.internal.t.b(this.f40803c, q0Var.f40803c) && kotlin.jvm.internal.t.b(this.f40801a, q0Var.f40801a);
    }

    public final q2.m0 f() {
        return this.f40803c;
    }

    public final long g() {
        return this.f40802b;
    }

    public final String h() {
        return this.f40801a.j();
    }

    public int hashCode() {
        int hashCode = ((this.f40801a.hashCode() * 31) + q2.m0.o(this.f40802b)) * 31;
        q2.m0 m0Var = this.f40803c;
        return hashCode + (m0Var != null ? q2.m0.o(m0Var.r()) : 0);
    }

    public String toString() {
        return "TextFieldValue(text='" + ((Object) this.f40801a) + "', selection=" + ((Object) q2.m0.q(this.f40802b)) + ", composition=" + this.f40803c + ')';
    }

    public /* synthetic */ q0(q2.d dVar, long j10, q2.m0 m0Var, kotlin.jvm.internal.k kVar) {
        this(dVar, j10, m0Var);
    }

    private q0(q2.d dVar, long j10, q2.m0 m0Var) {
        this.f40801a = dVar;
        this.f40802b = q2.n0.c(j10, 0, h().length());
        this.f40803c = m0Var != null ? q2.m0.b(q2.n0.c(m0Var.r(), 0, h().length())) : null;
    }

    public /* synthetic */ q0(q2.d dVar, long j10, q2.m0 m0Var, int i10, kotlin.jvm.internal.k kVar) {
        this(dVar, (i10 & 2) != 0 ? q2.m0.f33348b.a() : j10, (i10 & 4) != 0 ? null : m0Var, (kotlin.jvm.internal.k) null);
    }

    public /* synthetic */ q0(String str, long j10, q2.m0 m0Var, int i10, kotlin.jvm.internal.k kVar) {
        this((i10 & 1) != 0 ? "" : str, (i10 & 2) != 0 ? q2.m0.f33348b.a() : j10, (i10 & 4) != 0 ? null : m0Var, (kotlin.jvm.internal.k) null);
    }

    /* JADX WARN: Illegal instructions before constructor call */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    private q0(String str, long j10, q2.m0 m0Var) {
        this(new q2.d(str, null, null, 6, r5), j10, m0Var, r5);
        kotlin.jvm.internal.k kVar = null;
    }
}
