package com.vinfast.companion.notification.ui.fota;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
@dagger.hilt.android.lifecycle.HiltViewModel
@kotlin.Metadata(d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\b\u0007\u0018\u00002\u00020\u0001B!\b\u0007\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\u0006\u0010\u0005\u001a\u00020\u0004\u0012\u0006\u0010\u0007\u001a\u00020\u0006¢\u0006\u0004\b\b\u0010\tJ\u0015\u0010\r\u001a\u00020\f2\u0006\u0010\u000b\u001a\u00020\n¢\u0006\u0004\b\r\u0010\u000eR\u0014\u0010\u0003\u001a\u00020\u00028\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u000f\u0010\u0010R\u0014\u0010\u0007\u001a\u00020\u00068\u0002X\u0082\u0004¢\u0006\u0006\n\u0004\b\u0011\u0010\u0012R\u001c\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\u00140\u00138\u0002@\u0002X\u0082\u000e¢\u0006\u0006\n\u0004\b\u0015\u0010\u0016R\u001d\u0010\u001d\u001a\b\u0012\u0004\u0012\u00020\u00140\u00188\u0006¢\u0006\f\n\u0004\b\u0019\u0010\u001a\u001a\u0004\b\u001b\u0010\u001c¨\u0006\u001e"}, d2 = {"Lcom/vinfast/companion/notification/ui/fota/NotificationFotaInstallCompletedViewModel;", "Lcom/vinfast/companion/notification/ui/detail/NotificationDetailViewModel;", "Lcom/vinfast/companion/vehiclekit/data/repository/FotaRepository;", "fotaRepository", "Lcom/vinfast/companion/notificationkit/manager/INotificationManager;", "notificationManager", "Lcom/vinfast/companion/vehiclekit/data/manager/IVehicleManager;", "vehicleManager", "<init>", "(Lcom/vinfast/companion/vehiclekit/data/repository/FotaRepository;Lcom/vinfast/companion/notificationkit/manager/INotificationManager;Lcom/vinfast/companion/vehiclekit/data/manager/IVehicleManager;)V", "", "campaignId", "", "M", "(Ljava/lang/String;)V", "n", "Lcom/vinfast/companion/vehiclekit/data/repository/FotaRepository;", "o", "Lcom/vinfast/companion/vehiclekit/data/manager/IVehicleManager;", "Landroidx/lifecycle/MutableLiveData;", "Lcom/vinfast/companion/notification/ui/fota/LearnMoreResult;", "p", "Landroidx/lifecycle/MutableLiveData;", "_learnMoreResult", "Landroidx/lifecycle/LiveData;", "q", "Landroidx/lifecycle/LiveData;", "N", "()Landroidx/lifecycle/LiveData;", "learnMoreResult", "notification_release"}, k = 1, mv = {2, 2, 0}, xi = 48)
public final class NotificationFotaInstallCompletedViewModel extends com.vinfast.companion.notification.ui.detail.NotificationDetailViewModel {

    /* JADX INFO: renamed from: n, reason: from kotlin metadata */
    private final com.vinfast.companion.vehiclekit.data.repository.FotaRepository fotaRepository;

    /* JADX INFO: renamed from: o, reason: from kotlin metadata */
    private final com.vinfast.companion.vehiclekit.data.manager.IVehicleManager vehicleManager;

    /* JADX INFO: renamed from: p, reason: from kotlin metadata */
    private androidx.lifecycle.MutableLiveData _learnMoreResult;

    /* JADX INFO: renamed from: q, reason: from kotlin metadata */
    private final androidx.lifecycle.LiveData learnMoreResult;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public NotificationFotaInstallCompletedViewModel(com.vinfast.companion.vehiclekit.data.repository.FotaRepository fotaRepository, com.vinfast.companion.notificationkit.manager.INotificationManager iNotificationManager, com.vinfast.companion.vehiclekit.data.manager.IVehicleManager iVehicleManager) {
        super(iNotificationManager);
        kotlin.jvm.internal.Intrinsics.l(fotaRepository, "fotaRepository");
        kotlin.jvm.internal.Intrinsics.l(iNotificationManager, "notificationManager");
        kotlin.jvm.internal.Intrinsics.l(iVehicleManager, "vehicleManager");
        this.fotaRepository = fotaRepository;
        this.vehicleManager = iVehicleManager;
        androidx.lifecycle.MutableLiveData mutableLiveData = new androidx.lifecycle.MutableLiveData();
        this._learnMoreResult = mutableLiveData;
        this.learnMoreResult = mutableLiveData;
    }

    public final void M(java.lang.String campaignId) {
        kotlin.jvm.internal.Intrinsics.l(campaignId, "campaignId");
        com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle vehicle = (com.vinfast.companion.vehiclekit.data.persistent.model.Vehicle) com.vinfast.companion.core.extensions.validity.ValidityExtensionKt.d(this.vehicleManager.o1());
        com.vinfast.companion.core.uiPrototype.base.VehicleType vehicleTypeI = vehicle != null ? vehicle.I() : null;
        if ((vehicleTypeI != null && true == vehicleTypeI.P()) || ((vehicleTypeI != null && true == vehicleTypeI.x()) || ((vehicleTypeI != null && true == vehicleTypeI.D()) || ((vehicleTypeI != null && true == vehicleTypeI.E()) || (vehicleTypeI != null && true == vehicleTypeI.F()))))) {
            io.reactivex.rxjava3.core.Single singleK = this.fotaRepository.c(campaignId).m(new io.reactivex.rxjava3.functions.Consumer() { // from class: com.vinfast.companion.notification.ui.fota.NotificationFotaInstallCompletedViewModel$getLearnMore$1
                /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
                public final void accept(com.vinfast.companion.core.base.BaseResponse baseResponse) {
                    kotlin.jvm.internal.Intrinsics.l(baseResponse, "it");
                    this.a._learnMoreResult.n(new com.vinfast.companion.notification.ui.fota.LearnMoreResult(true, (com.vinfast.companion.vehiclekit.domain.response.FotaLearnMoreDto) baseResponse.a()));
                }
            }).k(new io.reactivex.rxjava3.functions.Consumer() { // from class: com.vinfast.companion.notification.ui.fota.NotificationFotaInstallCompletedViewModel$getLearnMore$2
                /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
                public final void accept(java.lang.Throwable th) {
                    kotlin.jvm.internal.Intrinsics.l(th, "it");
                    this.a._learnMoreResult.n(new com.vinfast.companion.notification.ui.fota.LearnMoreResult(false, null, 2, null));
                }
            });
            kotlin.jvm.internal.Intrinsics.k(singleK, "doOnError(...)");
            com.vinfast.companion.core.base.BaseViewModel.E(this, singleK, (com.vinfast.companion.core.base.ProgressType) null, (kotlin.jvm.functions.Function1) null, 6, (java.lang.Object) null);
            return;
        }
        if ((vehicleTypeI == null || true != vehicleTypeI.t()) && ((vehicleTypeI == null || true != vehicleTypeI.H()) && ((vehicleTypeI == null || true != vehicleTypeI.I()) && ((vehicleTypeI == null || true != vehicleTypeI.J()) && ((vehicleTypeI == null || true != vehicleTypeI.K()) && ((vehicleTypeI == null || true != vehicleTypeI.M()) && ((vehicleTypeI == null || true != vehicleTypeI.w()) && ((vehicleTypeI == null || true != vehicleTypeI.Q()) && ((vehicleTypeI == null || true != vehicleTypeI.L()) && ((vehicleTypeI == null || true != vehicleTypeI.v()) && ((vehicleTypeI == null || true != vehicleTypeI.N()) && (vehicleTypeI == null || true != vehicleTypeI.O())))))))))))) {
            return;
        }
        io.reactivex.rxjava3.core.Single singleK2 = this.fotaRepository.m(campaignId).m(new io.reactivex.rxjava3.functions.Consumer() { // from class: com.vinfast.companion.notification.ui.fota.NotificationFotaInstallCompletedViewModel$getLearnMore$3
            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final void accept(com.vinfast.companion.vehiclekit.data.persistent.model.fota89.FotaInfo89 fotaInfo89) {
                com.vinfast.companion.vehiclekit.data.persistent.model.fota89.WhatNew89 whatNew89D;
                java.lang.String strA;
                com.vinfast.companion.vehiclekit.data.persistent.model.fota89.WhatNew89 whatNew89D2;
                kotlin.jvm.internal.Intrinsics.l(fotaInfo89, "it");
                java.lang.String strC = fotaInfo89.c();
                java.lang.String str = "";
                if (!kotlin.jvm.internal.Intrinsics.g(com.vinfast.companion.core.managers.VFLocale.c.a().e(), "vi") ? !((whatNew89D = fotaInfo89.d()) == null || (strA = whatNew89D.a()) == null) : !((whatNew89D2 = fotaInfo89.d()) == null || (strA = whatNew89D2.b()) == null)) {
                    str = strA;
                }
                com.vinfast.companion.vehiclekit.domain.response.FotaLearnMoreDto fotaLearnMoreDto = new com.vinfast.companion.vehiclekit.domain.response.FotaLearnMoreDto();
                fotaLearnMoreDto.c(strC);
                fotaLearnMoreDto.d(str);
                this.a._learnMoreResult.n(new com.vinfast.companion.notification.ui.fota.LearnMoreResult(true, fotaLearnMoreDto));
            }
        }).k(new io.reactivex.rxjava3.functions.Consumer() { // from class: com.vinfast.companion.notification.ui.fota.NotificationFotaInstallCompletedViewModel$getLearnMore$4
            /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
            public final void accept(java.lang.Throwable th) {
                kotlin.jvm.internal.Intrinsics.l(th, "it");
                this.a._learnMoreResult.n(new com.vinfast.companion.notification.ui.fota.LearnMoreResult(false, null, 2, null));
            }
        });
        kotlin.jvm.internal.Intrinsics.k(singleK2, "doOnError(...)");
        com.vinfast.companion.core.base.BaseViewModel.E(this, singleK2, (com.vinfast.companion.core.base.ProgressType) null, (kotlin.jvm.functions.Function1) null, 6, (java.lang.Object) null);
    }

    /* JADX INFO: renamed from: N, reason: from getter */
    public final androidx.lifecycle.LiveData getLearnMoreResult() {
        return this.learnMoreResult;
    }
}
