package X6FRs_4.KNBe_11;
/* compiled from: ViewModelProvider.java */
/* loaded from: classes.dex */
public class ZzDuCHW_20 {
    public final RfjZ_21 KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public final KQgRr5e_0 f618KQgRr5e_0;

    /* compiled from: ViewModelProvider.java */
    /* loaded from: classes.dex */
    public interface KQgRr5e_0 {
        <T extends BVpCZyH_19> T KQgRr5e_0(Class<T> cls);
    }

    public ZzDuCHW_20(RfjZ_21 rfjZ_21, KQgRr5e_0 kQgRr5e_0) {
        this.f618KQgRr5e_0 = kQgRr5e_0;
        this.KQgRr5e_0 = rfjZ_21;
    }

    public <T extends BVpCZyH_19> T KQgRr5e_0(Class<T> cls) {
        String canonicalName = cls.getCanonicalName();
        if (canonicalName != null) {
            return (T) KQgRr5e_0("androidx.lifecycle.ViewModelProvider.DefaultKey:" + canonicalName, cls);
        }
        throw new IllegalArgumentException("Local and anonymous classes can not be ViewModels");
    }

    public <T extends BVpCZyH_19> T KQgRr5e_0(String str, Class<T> cls) {
        T t = (T) this.KQgRr5e_0.KQgRr5e_0(str);
        if (cls.isInstance(t)) {
            return t;
        }
        T t2 = (T) this.f618KQgRr5e_0.KQgRr5e_0(cls);
        this.KQgRr5e_0.KQgRr5e_0(str, t2);
        return t2;
    }
}
