package y2;

import android.graphics.Typeface;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import q2.b0;
import q2.d;
import q2.o0;
import r2.z;
import v2.h0;
import v2.i;
import y0.y3;

/* loaded from: classes.dex */
public final class d implements q2.r {

    /* renamed from: a, reason: collision with root package name */
    private final String f51928a;

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

    /* renamed from: c, reason: collision with root package name */
    private final List f51930c;

    /* renamed from: d, reason: collision with root package name */
    private final List f51931d;

    /* renamed from: e, reason: collision with root package name */
    private final i.b f51932e;

    /* renamed from: f, reason: collision with root package name */
    private final c3.d f51933f;

    /* renamed from: g, reason: collision with root package name */
    private final g f51934g;

    /* renamed from: h, reason: collision with root package name */
    private final CharSequence f51935h;

    /* renamed from: i, reason: collision with root package name */
    private final z f51936i;

    /* renamed from: j, reason: collision with root package name */
    private u f51937j;

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

    /* renamed from: l, reason: collision with root package name */
    private final int f51939l;

    /* loaded from: classes.dex */
    static final class a extends kotlin.jvm.internal.v implements dn.r {
        a() {
            super(4);
        }

        public final Typeface a(v2.i iVar, v2.r rVar, int i10, int i11) {
            y3 b10 = d.this.g().b(iVar, rVar, i10, i11);
            if (b10 instanceof h0.a) {
                Object value = b10.getValue();
                kotlin.jvm.internal.t.e(value, "null cannot be cast to non-null type android.graphics.Typeface");
                return (Typeface) value;
            }
            u uVar = new u(b10, d.this.f51937j);
            d.this.f51937j = uVar;
            return uVar.a();
        }

        @Override // dn.r
        public /* bridge */ /* synthetic */ Object j(Object obj, Object obj2, Object obj3, Object obj4) {
            return a((v2.i) obj, (v2.r) obj2, ((v2.p) obj3).i(), ((v2.q) obj4).k());
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r12v0, types: [java.util.List] */
    /* JADX WARN: Type inference failed for: r12v1 */
    /* JADX WARN: Type inference failed for: r12v3, types: [java.util.ArrayList] */
    public d(String str, o0 o0Var, List list, List list2, i.b bVar, c3.d dVar) {
        boolean c10;
        this.f51928a = str;
        this.f51929b = o0Var;
        this.f51930c = list;
        this.f51931d = list2;
        this.f51932e = bVar;
        this.f51933f = dVar;
        g gVar = new g(1, dVar.getDensity());
        this.f51934g = gVar;
        c10 = e.c(o0Var);
        this.f51938k = !c10 ? false : ((Boolean) o.f51958a.a().getValue()).booleanValue();
        this.f51939l = e.d(o0Var.B(), o0Var.u());
        a aVar = new a();
        z2.d.e(gVar, o0Var.E());
        b0 a10 = z2.d.a(gVar, o0Var.M(), aVar, dVar, !((Collection) list).isEmpty());
        if (a10 != null) {
            int size = list.size() + 1;
            list = new ArrayList(size);
            int i10 = 0;
            while (i10 < size) {
                list.add(i10 == 0 ? new d.c(a10, 0, this.f51928a.length()) : (d.c) this.f51930c.get(i10 - 1));
                i10++;
            }
        }
        CharSequence a11 = c.a(this.f51928a, this.f51934g.getTextSize(), this.f51929b, list, this.f51931d, this.f51933f, aVar, this.f51938k);
        this.f51935h = a11;
        this.f51936i = new z(a11, this.f51934g, this.f51939l);
    }

    @Override // q2.r
    public float a() {
        return this.f51936i.c();
    }

    @Override // q2.r
    public float b() {
        return this.f51936i.b();
    }

    @Override // q2.r
    public boolean c() {
        boolean c10;
        u uVar = this.f51937j;
        if (!(uVar != null ? uVar.b() : false)) {
            if (this.f51938k) {
                return false;
            }
            c10 = e.c(this.f51929b);
            if (!c10 || !((Boolean) o.f51958a.a().getValue()).booleanValue()) {
                return false;
            }
        }
        return true;
    }

    public final CharSequence f() {
        return this.f51935h;
    }

    public final i.b g() {
        return this.f51932e;
    }

    public final z h() {
        return this.f51936i;
    }

    public final o0 i() {
        return this.f51929b;
    }

    public final int j() {
        return this.f51939l;
    }

    public final g k() {
        return this.f51934g;
    }
}
