package androidx.lifecycle;

import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

/* loaded from: classes.dex */
public class d1 {

    /* renamed from: a, reason: collision with root package name */
    private final Map f4797a = new LinkedHashMap();

    public final void a() {
        Iterator it = this.f4797a.values().iterator();
        while (it.hasNext()) {
            ((z0) it.next()).M();
        }
        this.f4797a.clear();
    }

    public final z0 b(String key) {
        kotlin.jvm.internal.t.g(key, "key");
        return (z0) this.f4797a.get(key);
    }

    public final Set c() {
        return new HashSet(this.f4797a.keySet());
    }

    public final void d(String key, z0 viewModel) {
        kotlin.jvm.internal.t.g(key, "key");
        kotlin.jvm.internal.t.g(viewModel, "viewModel");
        z0 z0Var = (z0) this.f4797a.put(key, viewModel);
        if (z0Var != null) {
            z0Var.M();
        }
    }
}
