package q6;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import kotlin.jvm.internal.q;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import kotlin.jvm.internal.v0;
import p6.l;
import sm.q0;

/* loaded from: classes.dex */
public final class m implements p6.l {

    /* renamed from: p, reason: collision with root package name */
    private final p6.l f33486p;

    /* renamed from: q, reason: collision with root package name */
    private final dn.l f33487q;

    /* renamed from: r, reason: collision with root package name */
    private final dn.l f33488r;

    /* renamed from: s, reason: collision with root package name */
    private final dn.l f33489s;

    /* renamed from: t, reason: collision with root package name */
    private final dn.l f33490t;

    /* renamed from: u, reason: collision with root package name */
    private final dn.l f33491u;

    /* renamed from: v, reason: collision with root package name */
    private final dn.l f33492v;

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public /* synthetic */ class a extends q implements dn.l {
        a(Object obj) {
            super(1, obj, m.class, "fwdEntryView", "fwdEntryView(Ljava/util/Map$Entry;)Laws/smithy/kotlin/runtime/collections/views/MutableEntryView;", 0);
        }

        @Override // dn.l
        /* renamed from: l, reason: merged with bridge method [inline-methods] */
        public final i invoke(Map.Entry p02) {
            t.g(p02, "p0");
            return ((m) this.receiver).g(p02);
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public /* synthetic */ class b extends q implements dn.l {
        b(Object obj) {
            super(1, obj, m.class, "revEntryView", "revEntryView(Ljava/util/Map$Entry;)Laws/smithy/kotlin/runtime/collections/views/MutableEntryView;", 0);
        }

        @Override // dn.l
        /* renamed from: l, reason: merged with bridge method [inline-methods] */
        public final i invoke(Map.Entry p02) {
            t.g(p02, "p0");
            return ((m) this.receiver).z(p02);
        }
    }

    /* loaded from: classes.dex */
    static final class c extends v implements dn.l {
        c() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final List invoke(List it) {
            t.g(it, "it");
            ArrayList arrayList = new ArrayList();
            dn.l lVar = m.this.f33490t;
            Iterator it2 = it.iterator();
            while (it2.hasNext()) {
                arrayList.add(lVar.invoke(it2.next()));
            }
            return arrayList;
        }
    }

    /* loaded from: classes.dex */
    static final class d extends v implements dn.l {
        d() {
            super(1);
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final l invoke(List it) {
            t.g(it, "it");
            return q6.b.f(it, m.this.f33489s, m.this.f33490t);
        }
    }

    public m(p6.l src, dn.l kSrc2Dest, dn.l kDest2Src, dn.l vSrc2Dest, dn.l vDest2Src) {
        t.g(src, "src");
        t.g(kSrc2Dest, "kSrc2Dest");
        t.g(kDest2Src, "kDest2Src");
        t.g(vSrc2Dest, "vSrc2Dest");
        t.g(vDest2Src, "vDest2Src");
        this.f33486p = src;
        this.f33487q = kSrc2Dest;
        this.f33488r = kDest2Src;
        this.f33489s = vSrc2Dest;
        this.f33490t = vDest2Src;
        this.f33491u = new d();
        this.f33492v = new c();
    }

    private final List f(Object obj) {
        Object j10;
        List list = (List) get(obj);
        if (list != null) {
            return list;
        }
        this.f33486p.put((p6.l) this.f33488r.invoke(obj), (Object) new ArrayList());
        j10 = q0.j(this, obj);
        return (List) j10;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final i g(Map.Entry entry) {
        return new i(entry, this.f33487q, this.f33491u, this.f33492v);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final i z(Map.Entry entry) {
        return new i(entry, this.f33488r, this.f33492v, this.f33491u);
    }

    @Override // java.util.Map
    public void clear() {
        this.f33486p.clear();
    }

    @Override // java.util.Map
    public boolean containsKey(Object obj) {
        return this.f33486p.containsKey(this.f33488r.invoke(obj));
    }

    @Override // java.util.Map
    public final /* bridge */ boolean containsValue(Object obj) {
        if (v0.l(obj)) {
            return e((List) obj);
        }
        return false;
    }

    public boolean e(List value) {
        t.g(value, "value");
        return this.f33486p.containsValue(this.f33492v.invoke(value));
    }

    @Override // java.util.Map
    public final /* bridge */ Set entrySet() {
        return m();
    }

    @Override // java.util.Map
    /* renamed from: h, reason: merged with bridge method [inline-methods] */
    public List get(Object obj) {
        List list = (List) this.f33486p.get(this.f33488r.invoke(obj));
        if (list != null) {
            return (List) this.f33491u.invoke(list);
        }
        return null;
    }

    @Override // java.util.Map
    public boolean isEmpty() {
        return this.f33486p.isEmpty();
    }

    @Override // java.util.Map
    public final /* bridge */ Set keySet() {
        return p();
    }

    public Set m() {
        return q6.b.h(this.f33486p.entrySet(), new a(this), new b(this));
    }

    public Set p() {
        return q6.b.h(this.f33486p.keySet(), this.f33487q, this.f33488r);
    }

    @Override // java.util.Map
    public void putAll(Map from) {
        t.g(from, "from");
        for (Map.Entry entry : from.entrySet()) {
            this.f33486p.put((p6.l) this.f33488r.invoke(entry.getKey()), this.f33492v.invoke((List) entry.getValue()));
        }
    }

    @Override // p6.l
    public p6.j q() {
        return l.a.c(this);
    }

    public int r() {
        return this.f33486p.size();
    }

    @Override // java.util.Map
    public final /* bridge */ int size() {
        return r();
    }

    public Collection t() {
        return q6.b.c(this.f33486p.values(), this.f33491u, this.f33492v);
    }

    @Override // p6.l
    public boolean u(Object obj, Collection values) {
        t.g(values, "values");
        return f(obj).addAll(values);
    }

    @Override // p6.l
    public void v(Map map) {
        l.a.a(this, map);
    }

    @Override // java.util.Map
    public final /* bridge */ Collection values() {
        return t();
    }

    @Override // java.util.Map
    /* renamed from: w, reason: merged with bridge method [inline-methods] */
    public List put(Object obj, List value) {
        t.g(value, "value");
        List list = (List) this.f33486p.put((p6.l) this.f33488r.invoke(obj), this.f33492v.invoke(value));
        if (list != null) {
            return (List) this.f33491u.invoke(list);
        }
        return null;
    }

    @Override // java.util.Map
    /* renamed from: y, reason: merged with bridge method [inline-methods] */
    public List remove(Object obj) {
        List list = (List) this.f33486p.remove(this.f33488r.invoke(obj));
        if (list != null) {
            return (List) this.f33491u.invoke(list);
        }
        return null;
    }

    @Override // p6.l, java.util.Map
    public List put(Object obj, Object obj2) {
        return l.a.b(this, obj, obj2);
    }
}
