package d3;

import V2.P2;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.State;
import j$.time.format.DateTimeFormatter;
import java.util.Iterator;
import java.util.List;
import m3.AbstractC2467b;
import w4.C3137A;

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

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public int f16188a;

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

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

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

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

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

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final /* synthetic */ X2.f f16194j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final /* synthetic */ boolean f16195k;
    public final /* synthetic */ String l;

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C1941y1(P2 p22, int i6, int i7, MutableState mutableState, MutableState mutableState2, X2.f fVar, boolean z6, String str, State state, A4.d dVar) {
        super(2, dVar);
        this.f16189b = p22;
        this.f16190c = i6;
        this.f16191d = i7;
        this.f16192e = mutableState;
        this.f16193f = mutableState2;
        this.f16194j = fVar;
        this.f16195k = z6;
        this.l = str;
        this.f16196m = state;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new C1941y1(this.f16189b, this.f16190c, this.f16191d, this.f16192e, this.f16193f, this.f16194j, this.f16195k, this.l, this.f16196m, dVar);
    }

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

    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        Object objH;
        Object next;
        String str;
        String string;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f16188a;
        C3137A c3137a = C3137A.f25453a;
        int i7 = this.f16190c;
        MutableState mutableState = this.f16193f;
        MutableState mutableState2 = this.f16192e;
        int i8 = this.f16191d;
        try {
            if (i6 == 0) {
                AbstractC2467b.l(obj);
                P2 p22 = this.f16189b;
                int i9 = p22 != null ? p22.f7478a : 0;
                if (p22 == null || !p22.f7480c || i9 <= 0 || i7 <= 0 || i8 <= 0) {
                    DateTimeFormatter dateTimeFormatter = v2.f16084a;
                    mutableState2.setValue(null);
                    mutableState.setValue(null);
                    return c3137a;
                }
                DateTimeFormatter dateTimeFormatter2 = v2.f16084a;
                mutableState2.setValue(null);
                mutableState.setValue(null);
                c5.e eVar = V4.N.f8259a;
                c5.d dVar = c5.d.f13466b;
                C1938x1 c1938x1 = new C1938x1(this.f16194j, i9, this.f16190c, this.f16195k, this.l, this.f16196m, null);
                this.f16188a = 1;
                objH = V4.E.H(dVar, c1938x1, this);
                if (objH == aVar) {
                    return aVar;
                }
            } else {
                if (i6 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC2467b.l(obj);
                objH = obj;
            }
            Iterator it = ((List) objH).iterator();
            while (true) {
                if (!it.hasNext()) {
                    next = null;
                    break;
                }
                next = it.next();
                if (((X2.i) next).f8597e == i8) {
                    break;
                }
            }
            X2.i iVar = (X2.i) next;
            String string2 = iVar != null ? S4.p.o1(iVar.f8594b).toString() : null;
            if (string2 == null) {
                string2 = "";
            }
            if (S4.p.Q0(string2)) {
                str = "S" + i7 + ":E" + i8;
            } else {
                str = "S" + i7 + ":E" + i8 + " - " + string2;
            }
            DateTimeFormatter dateTimeFormatter3 = v2.f16084a;
            mutableState2.setValue(str);
            if (iVar == null || (string = S4.p.o1(iVar.f8595c).toString()) == null || string.length() <= 0) {
                string = null;
            }
            mutableState.setValue(string);
            return c3137a;
        } catch (Exception unused) {
            DateTimeFormatter dateTimeFormatter4 = v2.f16084a;
            mutableState2.setValue(null);
            mutableState.setValue(null);
            return c3137a;
        }
    }
}
