package com.sistemasolton.itranvias.home.presentation.home;

import androidx.compose.runtime.ProduceStateScope;
import com.sistemasolton.itranvias.data.preferences.SettingsRepository;
import kotlin.Metadata;
import kotlin.ResultKt;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;
import kotlin.jvm.functions.Function2;
import kotlinx.coroutines.flow.FlowCollector;

/* JADX INFO: compiled from: HomeScreen.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000e\u0010\u0000\u001a\u00020\u0001*\n\u0012\u0006\u0012\u0004\u0018\u00010\u00030\u0002H\n"}, d2 = {"<anonymous>", "", "Landroidx/compose/runtime/ProduceStateScope;", ""}, k = 3, mv = {2, 1, 0}, xi = 48)
@DebugMetadata(c = "com.sistemasolton.itranvias.home.presentation.home.HomeScreenKt$HomeScreen$preferredTab$2$1", f = "HomeScreen.kt", i = {}, l = {62}, m = "invokeSuspend", n = {}, s = {})
final class HomeScreenKt$HomeScreen$preferredTab$2$1 extends SuspendLambda implements Function2<ProduceStateScope<String>, Continuation<? super Unit>, Object> {
    final /* synthetic */ SettingsRepository $settingsRepository;
    private /* synthetic */ Object L$0;
    int label;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    HomeScreenKt$HomeScreen$preferredTab$2$1(SettingsRepository settingsRepository, Continuation<? super HomeScreenKt$HomeScreen$preferredTab$2$1> continuation) {
        super(2, continuation);
        this.$settingsRepository = settingsRepository;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
        HomeScreenKt$HomeScreen$preferredTab$2$1 homeScreenKt$HomeScreen$preferredTab$2$1 = new HomeScreenKt$HomeScreen$preferredTab$2$1(this.$settingsRepository, continuation);
        homeScreenKt$HomeScreen$preferredTab$2$1.L$0 = obj;
        return homeScreenKt$HomeScreen$preferredTab$2$1;
    }

    @Override // kotlin.jvm.functions.Function2
    public final Object invoke(ProduceStateScope<String> produceStateScope, Continuation<? super Unit> continuation) {
        return ((HomeScreenKt$HomeScreen$preferredTab$2$1) create(produceStateScope, continuation)).invokeSuspend(Unit.INSTANCE);
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) throws Throwable {
        Object coroutine_suspended = IntrinsicsKt.getCOROUTINE_SUSPENDED();
        int i = this.label;
        if (i == 0) {
            ResultKt.throwOnFailure(obj);
            final ProduceStateScope produceStateScope = (ProduceStateScope) this.L$0;
            this.label = 1;
            if (this.$settingsRepository.getPreferredTabFlow().collect(new FlowCollector() { // from class: com.sistemasolton.itranvias.home.presentation.home.HomeScreenKt$HomeScreen$preferredTab$2$1.1
                @Override // kotlinx.coroutines.flow.FlowCollector
                public /* bridge */ /* synthetic */ Object emit(Object obj2, Continuation continuation) {
                    return emit((String) obj2, (Continuation<? super Unit>) continuation);
                }

                public final Object emit(String str, Continuation<? super Unit> continuation) {
                    produceStateScope.setValue(str);
                    return Unit.INSTANCE;
                }
            }, this) == coroutine_suspended) {
                return coroutine_suspended;
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            ResultKt.throwOnFailure(obj);
        }
        return Unit.INSTANCE;
    }
}