package com.sistemasolton.itranvias.home.data.repository;

import com.sistemasolton.itranvias.home.data.local.dao.InfoDao;
import com.sistemasolton.itranvias.home.data.local.entity.InfoEntity;
import com.sistemasolton.itranvias.home.data.mappers.InfoMappersKt;
import com.sistemasolton.itranvias.home.data.remote.dto.infodto.InfoDto;
import com.sistemasolton.itranvias.home.domain.repository.InfoLocalRepository;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.coroutines.jvm.internal.ContinuationImpl;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.flow.Flow;
import kotlinx.coroutines.flow.FlowCollector;

/* JADX INFO: compiled from: InfoLocalRepositoryImpl.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\b\u0007\u0018\u00002\u00020\u0001B\u000f\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0004\b\u0004\u0010\u0005J\u0010\u0010\u0006\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\b0\u0007H\u0016J\u0016\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\bH\u0096@¢\u0006\u0002\u0010\fR\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Lcom/sistemasolton/itranvias/home/data/repository/InfoLocalRepositoryImpl;", "Lcom/sistemasolton/itranvias/home/domain/repository/InfoLocalRepository;", "dao", "Lcom/sistemasolton/itranvias/home/data/local/dao/InfoDao;", "<init>", "(Lcom/sistemasolton/itranvias/home/data/local/dao/InfoDao;)V", "getInfo", "Lkotlinx/coroutines/flow/Flow;", "Lcom/sistemasolton/itranvias/home/data/remote/dto/infodto/InfoDto;", "saveInfo", "", "info", "(Lcom/sistemasolton/itranvias/home/data/remote/dto/infodto/InfoDto;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "composeApp_release"}, k = 1, mv = {2, 1, 0}, xi = 48)
public final class InfoLocalRepositoryImpl implements InfoLocalRepository {
    public static final int $stable = 8;
    private final InfoDao dao;

    public InfoLocalRepositoryImpl(InfoDao dao) {
        Intrinsics.checkNotNullParameter(dao, "dao");
        this.dao = dao;
    }

    @Override // com.sistemasolton.itranvias.home.domain.repository.InfoLocalRepository
    public Flow<InfoDto> getInfo() {
        final Flow<InfoEntity> info = this.dao.getInfo();
        return new Flow<InfoDto>() { // from class: com.sistemasolton.itranvias.home.data.repository.InfoLocalRepositoryImpl$getInfo$$inlined$map$1

            /* JADX INFO: renamed from: com.sistemasolton.itranvias.home.data.repository.InfoLocalRepositoryImpl$getInfo$$inlined$map$1$2, reason: invalid class name */
            /* JADX INFO: compiled from: Emitters.kt */
            @Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0007\u0010\u0000\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u00032\u0006\u0010\u0004\u001a\u0002H\u0002H\u008a@¢\u0006\u0004\b\u0005\u0010\u0006¨\u0006\b"}, d2 = {"<anonymous>", "", "T", "R", "value", "emit", "(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "kotlinx/coroutines/flow/FlowKt__EmittersKt$unsafeTransform$1$1", "kotlinx/coroutines/flow/FlowKt__TransformKt$map$$inlined$unsafeTransform$1$2"}, k = 3, mv = {2, 1, 0}, xi = 48)
            public static final class AnonymousClass2<T> implements FlowCollector {
                final /* synthetic */ FlowCollector $this_unsafeFlow;

                /* JADX INFO: renamed from: com.sistemasolton.itranvias.home.data.repository.InfoLocalRepositoryImpl$getInfo$$inlined$map$1$2$1, reason: invalid class name */
                /* JADX INFO: compiled from: Emitters.kt */
                @Metadata(k = 3, mv = {2, 1, 0}, xi = 48)
                @DebugMetadata(c = "com.sistemasolton.itranvias.home.data.repository.InfoLocalRepositoryImpl$getInfo$$inlined$map$1$2", f = "InfoLocalRepositoryImpl.kt", i = {}, l = {219}, m = "emit", n = {}, s = {})
                public static final class AnonymousClass1 extends ContinuationImpl {
                    Object L$0;
                    int label;
                    /* synthetic */ Object result;

                    public AnonymousClass1(Continuation continuation) {
                        super(continuation);
                    }

                    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
                    public final Object invokeSuspend(Object obj) {
                        this.result = obj;
                        this.label |= Integer.MIN_VALUE;
                        return AnonymousClass2.this.emit(null, this);
                    }
                }

                public AnonymousClass2(FlowCollector flowCollector) {
                    this.$this_unsafeFlow = flowCollector;
                }

                /* JADX WARN: Removed duplicated region for block: B:7:0x0014  */
                @Override // kotlinx.coroutines.flow.FlowCollector
                /*
                    Code decompiled incorrectly, please refer to instructions dump.
                    To view partially-correct code enable 'Show inconsistent code' option in preferences
                */
                public final java.lang.Object emit(java.lang.Object r5, kotlin.coroutines.Continuation r6) throws java.lang.Throwable {
                    /*
                        r4 = this;
                        boolean r0 = r6 instanceof com.sistemasolton.itranvias.home.data.repository.InfoLocalRepositoryImpl$getInfo$$inlined$map$1.AnonymousClass2.AnonymousClass1
                        if (r0 == 0) goto L14
                        r0 = r6
                        com.sistemasolton.itranvias.home.data.repository.InfoLocalRepositoryImpl$getInfo$$inlined$map$1$2$1 r0 = (com.sistemasolton.itranvias.home.data.repository.InfoLocalRepositoryImpl$getInfo$$inlined$map$1.AnonymousClass2.AnonymousClass1) r0
                        int r1 = r0.label
                        r2 = -2147483648(0xffffffff80000000, float:-0.0)
                        r1 = r1 & r2
                        if (r1 == 0) goto L14
                        int r6 = r0.label
                        int r6 = r6 - r2
                        r0.label = r6
                        goto L19
                    L14:
                        com.sistemasolton.itranvias.home.data.repository.InfoLocalRepositoryImpl$getInfo$$inlined$map$1$2$1 r0 = new com.sistemasolton.itranvias.home.data.repository.InfoLocalRepositoryImpl$getInfo$$inlined$map$1$2$1
                        r0.<init>(r6)
                    L19:
                        java.lang.Object r6 = r0.result
                        java.lang.Object r1 = kotlin.coroutines.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED()
                        int r2 = r0.label
                        r3 = 1
                        if (r2 == 0) goto L32
                        if (r2 != r3) goto L2a
                        kotlin.ResultKt.throwOnFailure(r6)
                        goto L4d
                    L2a:
                        java.lang.IllegalStateException r5 = new java.lang.IllegalStateException
                        java.lang.String r6 = "call to 'resume' before 'invoke' with coroutine"
                        r5.<init>(r6)
                        throw r5
                    L32:
                        kotlin.ResultKt.throwOnFailure(r6)
                        kotlinx.coroutines.flow.FlowCollector r6 = r4.$this_unsafeFlow
                        r2 = r0
                        kotlin.coroutines.Continuation r2 = (kotlin.coroutines.Continuation) r2
                        com.sistemasolton.itranvias.home.data.local.entity.InfoEntity r5 = (com.sistemasolton.itranvias.home.data.local.entity.InfoEntity) r5
                        if (r5 == 0) goto L43
                        com.sistemasolton.itranvias.home.data.remote.dto.infodto.InfoDto r5 = com.sistemasolton.itranvias.home.data.mappers.InfoMappersKt.toDto(r5)
                        goto L44
                    L43:
                        r5 = 0
                    L44:
                        r0.label = r3
                        java.lang.Object r5 = r6.emit(r5, r0)
                        if (r5 != r1) goto L4d
                        return r1
                    L4d:
                        kotlin.Unit r5 = kotlin.Unit.INSTANCE
                        return r5
                    */
                    throw new UnsupportedOperationException("Method not decompiled: com.sistemasolton.itranvias.home.data.repository.InfoLocalRepositoryImpl$getInfo$$inlined$map$1.AnonymousClass2.emit(java.lang.Object, kotlin.coroutines.Continuation):java.lang.Object");
                }
            }

            @Override // kotlinx.coroutines.flow.Flow
            public Object collect(FlowCollector<? super InfoDto> flowCollector, Continuation continuation) {
                Object objCollect = info.collect(new AnonymousClass2(flowCollector), continuation);
                return objCollect == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? objCollect : Unit.INSTANCE;
            }
        };
    }

    @Override // com.sistemasolton.itranvias.home.domain.repository.InfoLocalRepository
    public Object saveInfo(InfoDto infoDto, Continuation<? super Unit> continuation) {
        Object objInsertInfo = this.dao.insertInfo(InfoMappersKt.toEntity(infoDto), continuation);
        return objInsertInfo == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? objInsertInfo : Unit.INSTANCE;
    }
}