package hp;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;

/* loaded from: classes3.dex */
public final class d0 implements d1, jp.h {

    /* renamed from: a, reason: collision with root package name */
    private e0 f21898a;

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

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

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class a extends kotlin.jvm.internal.v implements dn.l {
        a() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final m0 invoke(kotlin.reflect.jvm.internal.impl.types.checker.g kotlinTypeRefiner) {
            kotlin.jvm.internal.t.g(kotlinTypeRefiner, "kotlinTypeRefiner");
            return d0.this.o(kotlinTypeRefiner).b();
        }
    }

    /* loaded from: classes3.dex */
    public static final class b implements Comparator {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.l f21902p;

        public b(dn.l lVar) {
            this.f21902p = lVar;
        }

        @Override // java.util.Comparator
        public final int compare(Object obj, Object obj2) {
            int d10;
            e0 e0Var = (e0) obj;
            dn.l lVar = this.f21902p;
            kotlin.jvm.internal.t.d(e0Var);
            String obj3 = lVar.invoke(e0Var).toString();
            e0 e0Var2 = (e0) obj2;
            dn.l lVar2 = this.f21902p;
            kotlin.jvm.internal.t.d(e0Var2);
            d10 = um.c.d(obj3, lVar2.invoke(e0Var2).toString());
            return d10;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class c extends kotlin.jvm.internal.v implements dn.l {

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

        c() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final String invoke(e0 it) {
            kotlin.jvm.internal.t.g(it, "it");
            return it.toString();
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes3.dex */
    public static final class d extends kotlin.jvm.internal.v implements dn.l {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.l f21904p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        d(dn.l lVar) {
            super(1);
            this.f21904p = lVar;
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final CharSequence invoke(e0 e0Var) {
            dn.l lVar = this.f21904p;
            kotlin.jvm.internal.t.d(e0Var);
            return lVar.invoke(e0Var).toString();
        }
    }

    public d0(Collection typesToIntersect) {
        kotlin.jvm.internal.t.g(typesToIntersect, "typesToIntersect");
        typesToIntersect.isEmpty();
        LinkedHashSet linkedHashSet = new LinkedHashSet(typesToIntersect);
        this.f21899b = linkedHashSet;
        this.f21900c = linkedHashSet.hashCode();
    }

    public static /* synthetic */ String e(d0 d0Var, dn.l lVar, int i10, Object obj) {
        if ((i10 & 1) != 0) {
            lVar = c.f21903p;
        }
        return d0Var.d(lVar);
    }

    public final ap.h a() {
        return ap.n.f6163d.a("member scope for intersection type", this.f21899b);
    }

    public final m0 b() {
        List k10;
        z0 i10 = z0.f22028q.i();
        k10 = sm.u.k();
        return f0.l(i10, this, k10, false, a(), new a());
    }

    public final e0 c() {
        return this.f21898a;
    }

    public final String d(dn.l getProperTypeRelatedToStringify) {
        List J0;
        String m02;
        kotlin.jvm.internal.t.g(getProperTypeRelatedToStringify, "getProperTypeRelatedToStringify");
        J0 = sm.c0.J0(this.f21899b, new b(getProperTypeRelatedToStringify));
        m02 = sm.c0.m0(J0, " & ", "{", "}", 0, null, new d(getProperTypeRelatedToStringify), 24, null);
        return m02;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof d0) {
            return kotlin.jvm.internal.t.b(this.f21899b, ((d0) obj).f21899b);
        }
        return false;
    }

    @Override // hp.d1
    /* renamed from: f, reason: merged with bridge method [inline-methods] */
    public d0 o(kotlin.reflect.jvm.internal.impl.types.checker.g kotlinTypeRefiner) {
        int v10;
        kotlin.jvm.internal.t.g(kotlinTypeRefiner, "kotlinTypeRefiner");
        Collection n10 = n();
        v10 = sm.v.v(n10, 10);
        ArrayList arrayList = new ArrayList(v10);
        Iterator it = n10.iterator();
        boolean z10 = false;
        while (it.hasNext()) {
            arrayList.add(((e0) it.next()).U0(kotlinTypeRefiner));
            z10 = true;
        }
        d0 d0Var = null;
        if (z10) {
            e0 c10 = c();
            d0Var = new d0(arrayList).g(c10 != null ? c10.U0(kotlinTypeRefiner) : null);
        }
        return d0Var == null ? this : d0Var;
    }

    public final d0 g(e0 e0Var) {
        return new d0(this.f21899b, e0Var);
    }

    @Override // hp.d1
    public List getParameters() {
        List k10;
        k10 = sm.u.k();
        return k10;
    }

    public int hashCode() {
        return this.f21900c;
    }

    @Override // hp.d1
    public qn.g m() {
        qn.g m10 = ((e0) this.f21899b.iterator().next()).K0().m();
        kotlin.jvm.internal.t.f(m10, "getBuiltIns(...)");
        return m10;
    }

    @Override // hp.d1
    public Collection n() {
        return this.f21899b;
    }

    @Override // hp.d1
    public tn.h p() {
        return null;
    }

    @Override // hp.d1
    public boolean q() {
        return false;
    }

    public String toString() {
        return e(this, null, 1, null);
    }

    private d0(Collection collection, e0 e0Var) {
        this(collection);
        this.f21898a = e0Var;
    }
}
