package com.vinfast.companion.main.ui.gltestdrive.vehiclestep;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes3.dex */
@kotlin.Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\u0010\u0000\u001a\u00020\u00012\f\u0010\u0002\u001a\b\u0012\u0004\u0012\u00020\u00040\u0003H\n"}, d2 = {"<anonymous>", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "vehicleTestDrives", okhttp3.HttpUrl.FRAGMENT_ENCODE_SET, "Lcom/vinfast/companion/serviceskit/domain/response/TestDriveVehicle;"}, k = 3, mv = {2, 2, 0}, xi = 48)
@kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.main.ui.gltestdrive.vehiclestep.GlTestDriveVehicleStepViewModel$getServices$4", f = "GlTestDriveVehicleStepViewModel.kt", l = {}, m = "invokeSuspend", v = 1)
@kotlin.jvm.internal.SourceDebugExtension
final class GlTestDriveVehicleStepViewModel$getServices$4 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function2<java.util.List<? extends com.vinfast.companion.serviceskit.domain.response.TestDriveVehicle>, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
    int n;
    /* synthetic */ java.lang.Object o;
    final /* synthetic */ com.vinfast.companion.main.ui.gltestdrive.vehiclestep.GlTestDriveVehicleStepViewModel p;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    GlTestDriveVehicleStepViewModel$getServices$4(com.vinfast.companion.main.ui.gltestdrive.vehiclestep.GlTestDriveVehicleStepViewModel glTestDriveVehicleStepViewModel, kotlin.coroutines.Continuation continuation) {
        super(2, continuation);
        this.p = glTestDriveVehicleStepViewModel;
    }

    /* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
    public final java.lang.Object invoke(java.util.List list, kotlin.coroutines.Continuation continuation) {
        return create(list, continuation).invokeSuspend(kotlin.Unit.a);
    }

    public final kotlin.coroutines.Continuation create(java.lang.Object obj, kotlin.coroutines.Continuation continuation) {
        com.vinfast.companion.main.ui.gltestdrive.vehiclestep.GlTestDriveVehicleStepViewModel$getServices$4 glTestDriveVehicleStepViewModel$getServices$4 = new com.vinfast.companion.main.ui.gltestdrive.vehiclestep.GlTestDriveVehicleStepViewModel$getServices$4(this.p, continuation);
        glTestDriveVehicleStepViewModel$getServices$4.o = obj;
        return glTestDriveVehicleStepViewModel$getServices$4;
    }

    public final java.lang.Object invokeSuspend(java.lang.Object obj) {
        java.lang.Object next;
        java.util.List list = (java.util.List) this.o;
        kotlin.coroutines.intrinsics.IntrinsicsKt.g();
        if (this.n != 0) {
            throw new java.lang.IllegalStateException("call to 'resume' before 'invoke' with coroutine");
        }
        kotlin.ResultKt.b(obj);
        this.p._vehicleTestDriveItemsLiveData.n(list);
        com.vinfast.companion.serviceskit.domain.model.TestDriveInfo.Vehicle vehicleL = this.p.getTestDriveBookingManager().l();
        if (vehicleL != null) {
            com.vinfast.companion.main.ui.gltestdrive.vehiclestep.GlTestDriveVehicleStepViewModel glTestDriveVehicleStepViewModel = this.p;
            java.util.Iterator it = list.iterator();
            do {
                if (!it.hasNext()) {
                    next = null;
                    break;
                }
                next = it.next();
            } while (!kotlin.jvm.internal.Intrinsics.g(((com.vinfast.companion.serviceskit.domain.response.TestDriveVehicle) next).getId(), vehicleL.a().getId()));
            com.vinfast.companion.serviceskit.domain.response.TestDriveVehicle testDriveVehicle = (com.vinfast.companion.serviceskit.domain.response.TestDriveVehicle) next;
            if (testDriveVehicle != null) {
                glTestDriveVehicleStepViewModel._selectedVehicleTestDriveLiveData.q(testDriveVehicle);
            }
        }
        this.p.Z();
        return kotlin.Unit.a;
    }
}
