package d3;

import V2.Q2;
import androidx.compose.runtime.MutableState;
import androidx.compose.runtime.State;
import androidx.media3.exoplayer.ExoPlayer;
import j$.time.format.DateTimeFormatter;
import m3.AbstractC2467b;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final class D1 extends C4.j implements J4.e {

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

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

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

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

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

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

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

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

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public D1(boolean z6, ExoPlayer exoPlayer, State state, MutableState mutableState, MutableState mutableState2, State state2, MutableState mutableState3, MutableState mutableState4, MutableState mutableState5, A4.d dVar) {
        super(2, dVar);
        this.f15053b = z6;
        this.f15054c = exoPlayer;
        this.f15055d = state;
        this.f15056e = mutableState;
        this.f15057f = mutableState2;
        this.f15058j = state2;
        this.f15059k = mutableState3;
        this.l = mutableState4;
        this.f15060m = mutableState5;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        return new D1(this.f15053b, this.f15054c, this.f15055d, this.f15056e, this.f15057f, this.f15058j, this.f15059k, this.l, this.f15060m, dVar);
    }

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

    /* JADX WARN: Code restructure failed: missing block: B:41:0x00a7, code lost:
    
        if (V4.E.l(2000, r13) == r0) goto L52;
     */
    /* JADX WARN: Code restructure failed: missing block: B:51:0x00c6, code lost:
    
        if (V4.E.l(2000, r13) == r0) goto L52;
     */
    /* JADX WARN: Multi-variable type inference failed */
    @Override // C4.a
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invokeSuspend(Object obj) {
        B4.a aVar = B4.a.f492a;
        int i6 = this.f15052a;
        MutableState mutableState = this.l;
        ExoPlayer exoPlayer = this.f15054c;
        C3137A c3137a = C3137A.f25453a;
        MutableState mutableState2 = this.f15060m;
        MutableState mutableState3 = this.f15056e;
        if (i6 != 0) {
            if (i6 == 1) {
                AbstractC2467b.l(obj);
                v2.c0(mutableState3, false);
                return c3137a;
            }
            if (i6 != 2) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AbstractC2467b.l(obj);
            if (!exoPlayer.getPlayWhenReady()) {
                DateTimeFormatter dateTimeFormatter = v2.f16084a;
                if (((Long) mutableState.getValue()) == null && exoPlayer.getPlaybackState() != 2 && !((Boolean) mutableState2.getValue()).booleanValue()) {
                    v2.c0(mutableState3, true);
                    return c3137a;
                }
            }
            v2.c0(mutableState3, false);
            return c3137a;
        }
        AbstractC2467b.l(obj);
        DateTimeFormatter dateTimeFormatter2 = v2.f16084a;
        g3.n nVar = ((Q2) this.f15055d.getValue()).f7502g;
        if (!this.f15053b || nVar == null) {
            v2.c0(mutableState3, false);
            return c3137a;
        }
        if (((Boolean) this.f15057f.getValue()).booleanValue() || ((Boolean) this.f15058j.getValue()).booleanValue()) {
            v2.c0(mutableState3, false);
            return c3137a;
        }
        MutableState mutableState4 = this.f15059k;
        boolean z6 = ((Number) mutableState4.getValue()).intValue() == 2;
        boolean z7 = ((Long) mutableState.getValue()) != null;
        if (z6) {
            v2.c0(mutableState3, false);
            return c3137a;
        }
        boolean z8 = (exoPlayer.getPlayWhenReady() || z7 || ((Number) mutableState4.getValue()).intValue() == 1) ? false : true;
        if (exoPlayer.getPlayWhenReady() && !z6) {
            this.f15052a = 1;
        } else {
            if (!z8) {
                v2.c0(mutableState3, false);
                return c3137a;
            }
            if (((Boolean) mutableState2.getValue()).booleanValue()) {
                v2.c0(mutableState3, false);
                return c3137a;
            }
            this.f15052a = 2;
        }
        return aVar;
    }
}
