package com.vinfast.companion.corecompose;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.dex */
@kotlin.Metadata(d1 = {"\u0000\u0012\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\u0010\u0000\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H\n"}, d2 = {"<anonymous>", "", "T", "Lkotlinx/coroutines/flow/FlowCollector;", "it", ""}, k = 3, mv = {2, 2, 0}, xi = 48)
@kotlin.coroutines.jvm.internal.DebugMetadata(c = "com.vinfast.companion.corecompose.BaseViewModel$catchError$1", f = "BaseComposeViewModel.kt", l = {162, 164}, m = "invokeSuspend", v = 1)
final class BaseViewModel$catchError$1 extends kotlin.coroutines.jvm.internal.SuspendLambda implements kotlin.jvm.functions.Function3<kotlinx.coroutines.flow.FlowCollector<java.lang.Object>, java.lang.Throwable, kotlin.coroutines.Continuation<? super kotlin.Unit>, java.lang.Object> {
    java.lang.Object n;
    java.lang.Object o;
    int p;
    int q;
    private /* synthetic */ java.lang.Object r;
    /* synthetic */ java.lang.Object s;
    final /* synthetic */ com.vinfast.companion.corecompose.BaseViewModel t;
    final /* synthetic */ java.lang.Object u;
    final /* synthetic */ boolean v;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    BaseViewModel$catchError$1(com.vinfast.companion.corecompose.BaseViewModel baseViewModel, java.lang.Object obj, boolean z, kotlin.coroutines.Continuation continuation) {
        super(3, continuation);
        this.t = baseViewModel;
        this.u = obj;
        this.v = z;
    }

    /* JADX WARN: Code restructure failed: missing block: B:16:0x0082, code lost:
    
        if (r0.emit(r8, r7) == r2) goto L17;
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public final java.lang.Object invokeSuspend(java.lang.Object r8) {
        /*
            r7 = this;
            java.lang.Object r0 = r7.r
            kotlinx.coroutines.flow.FlowCollector r0 = (kotlinx.coroutines.flow.FlowCollector) r0
            java.lang.Object r1 = r7.s
            java.lang.Throwable r1 = (java.lang.Throwable) r1
            java.lang.Object r2 = kotlin.coroutines.intrinsics.IntrinsicsKt.g()
            int r3 = r7.q
            r4 = 2
            r5 = 1
            if (r3 == 0) goto L2e
            if (r3 == r5) goto L26
            if (r3 != r4) goto L1e
            java.lang.Object r7 = r7.n
            com.vinfast.companion.core.base.ViewModelState$Error r7 = (com.vinfast.companion.core.base.ViewModelState.Error) r7
            kotlin.ResultKt.b(r8)
            goto L85
        L1e:
            java.lang.IllegalStateException r7 = new java.lang.IllegalStateException
            java.lang.String r8 = "call to 'resume' before 'invoke' with coroutine"
            r7.<init>(r8)
            throw r7
        L26:
            java.lang.Object r3 = r7.n
            com.vinfast.companion.core.base.ViewModelState$Error r3 = (com.vinfast.companion.core.base.ViewModelState.Error) r3
            kotlin.ResultKt.b(r8)
            goto L5d
        L2e:
            kotlin.ResultKt.b(r8)
            com.vinfast.companion.core.utils.CAppShared r8 = com.vinfast.companion.core.utils.CAppShared.a
            com.vinfast.companion.core.managers.IErrorManager r8 = r8.c()
            com.vinfast.companion.core.base.ViewModelState$Error r3 = r8.a(r1)
            boolean r8 = r7.v
            r3.d(r8)
            com.vinfast.companion.corecompose.BaseViewModel r8 = r7.t
            kotlinx.coroutines.flow.MutableSharedFlow r8 = com.vinfast.companion.corecompose.BaseViewModel.f(r8)
            r7.r = r0
            java.lang.Object r6 = kotlin.coroutines.jvm.internal.SpillingKt.a(r1)
            r7.s = r6
            java.lang.Object r6 = kotlin.coroutines.jvm.internal.SpillingKt.a(r3)
            r7.n = r6
            r7.q = r5
            java.lang.Object r8 = r8.emit(r3, r7)
            if (r8 != r2) goto L5d
            goto L84
        L5d:
            java.lang.Object r8 = r7.u
            if (r8 == 0) goto L85
            java.lang.Object r5 = kotlin.coroutines.jvm.internal.SpillingKt.a(r0)
            r7.r = r5
            java.lang.Object r1 = kotlin.coroutines.jvm.internal.SpillingKt.a(r1)
            r7.s = r1
            java.lang.Object r1 = kotlin.coroutines.jvm.internal.SpillingKt.a(r3)
            r7.n = r1
            java.lang.Object r1 = kotlin.coroutines.jvm.internal.SpillingKt.a(r8)
            r7.o = r1
            r1 = 0
            r7.p = r1
            r7.q = r4
            java.lang.Object r7 = r0.emit(r8, r7)
            if (r7 != r2) goto L85
        L84:
            return r2
        L85:
            kotlin.Unit r7 = kotlin.Unit.a
            return r7
        */
        throw new UnsupportedOperationException("Method not decompiled: com.vinfast.companion.corecompose.BaseViewModel$catchError$1.invokeSuspend(java.lang.Object):java.lang.Object");
    }

    public final java.lang.Object invoke(kotlinx.coroutines.flow.FlowCollector flowCollector, java.lang.Throwable th, kotlin.coroutines.Continuation continuation) {
        com.vinfast.companion.corecompose.BaseViewModel$catchError$1 baseViewModel$catchError$1 = new com.vinfast.companion.corecompose.BaseViewModel$catchError$1(this.t, this.u, this.v, continuation);
        baseViewModel$catchError$1.r = flowCollector;
        baseViewModel$catchError$1.s = th;
        return baseViewModel$catchError$1.invokeSuspend(kotlin.Unit.a);
    }
}
