package vn;

import ap.c;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import sm.x0;
import tn.p0;

/* loaded from: classes3.dex */
public class h0 extends ap.i {

    /* renamed from: b, reason: collision with root package name */
    private final tn.g0 f40264b;

    /* renamed from: c, reason: collision with root package name */
    private final ro.c f40265c;

    public h0(tn.g0 moduleDescriptor, ro.c fqName) {
        kotlin.jvm.internal.t.g(moduleDescriptor, "moduleDescriptor");
        kotlin.jvm.internal.t.g(fqName, "fqName");
        this.f40264b = moduleDescriptor;
        this.f40265c = fqName;
    }

    @Override // ap.i, ap.k
    public Collection f(ap.d kindFilter, dn.l nameFilter) {
        List k10;
        List k11;
        kotlin.jvm.internal.t.g(kindFilter, "kindFilter");
        kotlin.jvm.internal.t.g(nameFilter, "nameFilter");
        if (!kindFilter.a(ap.d.f6107c.f())) {
            k11 = sm.u.k();
            return k11;
        }
        if (this.f40265c.d() && kindFilter.l().contains(c.b.f6106a)) {
            k10 = sm.u.k();
            return k10;
        }
        Collection n10 = this.f40264b.n(this.f40265c, nameFilter);
        ArrayList arrayList = new ArrayList(n10.size());
        Iterator it = n10.iterator();
        while (it.hasNext()) {
            ro.f g10 = ((ro.c) it.next()).g();
            kotlin.jvm.internal.t.f(g10, "shortName(...)");
            if (((Boolean) nameFilter.invoke(g10)).booleanValue()) {
                pp.a.a(arrayList, h(g10));
            }
        }
        return arrayList;
    }

    @Override // ap.i, ap.h
    public Set g() {
        Set d10;
        d10 = x0.d();
        return d10;
    }

    protected final p0 h(ro.f name) {
        kotlin.jvm.internal.t.g(name, "name");
        if (name.t()) {
            return null;
        }
        tn.g0 g0Var = this.f40264b;
        ro.c c10 = this.f40265c.c(name);
        kotlin.jvm.internal.t.f(c10, "child(...)");
        p0 M = g0Var.M(c10);
        if (M.isEmpty()) {
            return null;
        }
        return M;
    }

    public String toString() {
        return "subpackages of " + this.f40265c + " from " + this.f40264b;
    }
}
