package com.strmr.ps.data.subtitle;

import com.strmr.ps.data.model.addon.InstalledAddon;
import com.strmr.ps.data.subtitle.t;
import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.i50;
import defpackage.s38;
import defpackage.vx8;
import defpackage.wj0;
import defpackage.y41;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Lak1;", "", "Lcom/strmr/ps/data/subtitle/t$b;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.data.subtitle.SubtitleManager$searchExternalSubtitles$addonResults$1", f = "SubtitleManager.kt", i = {}, l = {409}, m = "invokeSuspend", n = {}, s = {})
@vx8
final class r extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends t.b>>, Object> {
    public int a;
    public /* synthetic */ Object b;
    public final /* synthetic */ List c;
    public final /* synthetic */ SubtitleManager d;
    public final /* synthetic */ String e;
    public final /* synthetic */ String f;
    public final /* synthetic */ String i;
    public final /* synthetic */ String j;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public r(List list, SubtitleManager subtitleManager, String str, String str2, String str3, String str4, Continuation continuation) {
        super(2, continuation);
        this.c = list;
        this.d = subtitleManager;
        this.e = str;
        this.f = str2;
        this.i = str3;
        this.j = str4;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        r rVar = new r(this.c, this.d, this.e, this.f, this.i, this.j, continuation);
        rVar.b = obj;
        return rVar;
    }

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        return ((r) create((ak1) obj, (Continuation) obj2)).invokeSuspend(e6a.a);
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) {
        ck1 ck1Var = ck1.a;
        int i = this.a;
        if (i == 0) {
            s38.b(obj);
            ak1 ak1Var = (ak1) this.b;
            List list = this.c;
            ArrayList arrayList = new ArrayList(y41.p(list, 10));
            Iterator it = list.iterator();
            while (it.hasNext()) {
                arrayList.add(wj0.a(ak1Var, null, new q((InstalledAddon) it.next(), this.d, this.e, this.f, this.i, this.j, null), 3));
            }
            this.a = 1;
            obj = i50.a(arrayList, this);
            if (obj == ck1Var) {
                return ck1Var;
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
        }
        return y41.ac((Iterable) obj);
    }
}
