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

import com.sistemasolton.itranvias.home.data.local.dao.StopHistoryDao;
import com.sistemasolton.itranvias.home.data.local.entity.StopHistoryEntity;
import com.sistemasolton.itranvias.home.domain.repository.StopHistoryRepository;
import java.util.List;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.intrinsics.IntrinsicsKt;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.flow.Flow;

/* JADX INFO: compiled from: StopHistoryRepositoryImpl.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\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0004\b\u0007\u0018\u00002\u00020\u0001B\u000f\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0004\b\u0004\u0010\u0005J\u0014\u0010\u0006\u001a\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\t0\b0\u0007H\u0016J\u0016\u0010\n\u001a\u00020\u000b2\u0006\u0010\f\u001a\u00020\rH\u0096@¢\u0006\u0002\u0010\u000eJ\u000e\u0010\u000f\u001a\u00020\u000bH\u0096@¢\u0006\u0002\u0010\u0010R\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0011"}, d2 = {"Lcom/sistemasolton/itranvias/home/data/repository/StopHistoryRepositoryImpl;", "Lcom/sistemasolton/itranvias/home/domain/repository/StopHistoryRepository;", "dao", "Lcom/sistemasolton/itranvias/home/data/local/dao/StopHistoryDao;", "<init>", "(Lcom/sistemasolton/itranvias/home/data/local/dao/StopHistoryDao;)V", "getRecentStops", "Lkotlinx/coroutines/flow/Flow;", "", "Lcom/sistemasolton/itranvias/home/data/local/entity/StopHistoryEntity;", "addStop", "", "stopCode", "", "(Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "clearHistory", "(Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "composeApp_release"}, k = 1, mv = {2, 1, 0}, xi = 48)
public final class StopHistoryRepositoryImpl implements StopHistoryRepository {
    public static final int $stable = 8;
    private final StopHistoryDao dao;

    public StopHistoryRepositoryImpl(StopHistoryDao dao) {
        Intrinsics.checkNotNullParameter(dao, "dao");
        this.dao = dao;
    }

    @Override // com.sistemasolton.itranvias.home.domain.repository.StopHistoryRepository
    public Flow<List<StopHistoryEntity>> getRecentStops() {
        return this.dao.getRecentStops();
    }

    @Override // com.sistemasolton.itranvias.home.domain.repository.StopHistoryRepository
    public Object addStop(String str, Continuation<? super Unit> continuation) {
        Object objInsertStop = this.dao.insertStop(new StopHistoryEntity(str, 0L, 2, null), continuation);
        return objInsertStop == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? objInsertStop : Unit.INSTANCE;
    }

    @Override // com.sistemasolton.itranvias.home.domain.repository.StopHistoryRepository
    public Object clearHistory(Continuation<? super Unit> continuation) {
        Object objClearHistory = this.dao.clearHistory(continuation);
        return objClearHistory == IntrinsicsKt.getCOROUTINE_SUSPENDED() ? objClearHistory : Unit.INSTANCE;
    }
}