package com.strmr.ps.data.service;

import com.strmr.ps.data.model.debrid.DebridFileItem;
import defpackage.ak1;
import defpackage.ck1;
import defpackage.e6a;
import defpackage.gr3;
import defpackage.i50;
import defpackage.s38;
import defpackage.u75;
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;", "", "Lu75;", "<anonymous>", "(Lak1;)Ljava/util/List;"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.data.service.DebridLibrarySearchService$drillSubfolders$2", f = "DebridLibrarySearchService.kt", i = {}, l = {371}, m = "invokeSuspend", n = {}, s = {})
@vx8
final class r extends SuspendLambda implements gr3<ak1, Continuation<? super List<? extends u75>>, Object> {
    public int a;
    public /* synthetic */ Object b;
    public final /* synthetic */ List c;
    public final /* synthetic */ boolean d;
    public final /* synthetic */ int e;
    public final /* synthetic */ DebridLibrarySearchService f;
    public final /* synthetic */ String i;
    public final /* synthetic */ int j;
    public final /* synthetic */ String k;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public r(List list, boolean z, int i, DebridLibrarySearchService debridLibrarySearchService, String str, int i2, String str2, Continuation continuation) {
        super(2, continuation);
        this.c = list;
        this.d = z;
        this.e = i;
        this.f = debridLibrarySearchService;
        this.i = str;
        this.j = i2;
        this.k = str2;
    }

    @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, this.k, 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 listBk = y41.bk(this.c, 5);
            ArrayList arrayList = new ArrayList(y41.p(listBk, 10));
            Iterator it = listBk.iterator();
            while (it.hasNext()) {
                arrayList.add(wj0.a(ak1Var, null, new q(this.e, this.j, (DebridFileItem.Folder) it.next(), this.f, this.i, this.k, null, this.d), 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.x((Iterable) obj);
    }
}
