package d3;

import V2.J2;
import V2.M3;
import V2.n3;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.State;
import androidx.media3.exoplayer.ExoPlayer;
import j$.time.format.DateTimeFormatter;
import java.util.Iterator;
import java.util.List;
import m3.AbstractC2467b;
import w4.C3137A;
import x4.AbstractC3226C;
import x4.AbstractC3252r;

/* JADX INFO: renamed from: d3.s1, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1923s1 extends C4.j implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ List f15980a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ M3 f15981b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ int f15982c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ ExoPlayer f15983d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final /* synthetic */ MutableState f15984e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final /* synthetic */ State f15985f;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C1923s1(List list, M3 m32, int i6, ExoPlayer exoPlayer, MutableState mutableState, State state, A4.d dVar) {
        super(2, dVar);
        this.f15980a = list;
        this.f15981b = m32;
        this.f15982c = i6;
        this.f15983d = exoPlayer;
        this.f15984e = mutableState;
        this.f15985f = state;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new C1923s1(this.f15980a, this.f15981b, this.f15982c, this.f15983d, this.f15984e, this.f15985f, dVar);
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        C1923s1 c1923s1 = (C1923s1) create((V4.C) obj, (A4.d) obj2);
        C3137A c3137a = C3137A.f25453a;
        c1923s1.invokeSuspend(c3137a);
        return c3137a;
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        Object obj2;
        Object next;
        int iIntValue;
        B4.a aVar = B4.a.f492a;
        AbstractC2467b.l(obj);
        DateTimeFormatter dateTimeFormatter = v2.f16084a;
        MutableState mutableState = this.f15984e;
        boolean zBooleanValue = ((Boolean) mutableState.getValue()).booleanValue();
        C3137A c3137a = C3137A.f25453a;
        if (!zBooleanValue) {
            List list = this.f15980a;
            if (!list.isEmpty()) {
                M3 m32 = this.f15981b;
                List listI0 = v2.i0(v2.z0(m32.f7448n), v2.z0(m32.f7449o), list);
                J2 j22 = ((n3) this.f15985f.getValue()).f7974d;
                Iterator it = listI0.iterator();
                while (true) {
                    obj2 = null;
                    if (!it.hasNext()) {
                        next = null;
                        break;
                    }
                    next = it.next();
                    if (!v2.h0((C) list.get(((Number) next).intValue()), j22)) {
                        break;
                    }
                }
                Integer num = (Integer) next;
                if (num != null) {
                    iIntValue = num.intValue();
                } else {
                    Integer num2 = new Integer(this.f15982c);
                    int iIntValue2 = num2.intValue();
                    if (iIntValue2 < 0 || v2.h0((C) list.get(iIntValue2), j22)) {
                        num2 = null;
                    }
                    if (num2 != null) {
                        iIntValue = num2.intValue();
                    } else {
                        Iterator it2 = AbstractC3252r.z(list).iterator();
                        while (true) {
                            if (!((P4.f) it2).f5681c) {
                                break;
                            }
                            Object next2 = ((AbstractC3226C) it2).next();
                            if (!v2.h0((C) list.get(((Number) next2).intValue()), j22)) {
                                obj2 = next2;
                                break;
                            }
                        }
                        Integer num3 = (Integer) obj2;
                        iIntValue = num3 != null ? num3.intValue() : 0;
                    }
                }
                v2.k0(this.f15983d, list, iIntValue, 1);
                mutableState.setValue(Boolean.TRUE);
            }
        }
        return c3137a;
    }
}
