package B;

import C0.C0124z;
import K.InterfaceC0489y0;
import V4.C0763h0;
import V4.InterfaceC0765i0;
import V4.InterfaceC0778p;
import android.app.RemoteAction;
import android.graphics.RectF;
import android.view.textclassifier.TextClassification;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.internal.ComposableLambda;
import androidx.compose.runtime.snapshots.Snapshot;
import androidx.compose.runtime.snapshots.SnapshotStateObserver;
import androidx.media3.exoplayer.analytics.AnalyticsListener;
import com.debridstream.tv.updater.UpdateViewModel;
import i0.C2245i;
import i0.C2246j;
import i0.InterfaceC2240d;
import i0.InterfaceC2241e;
import i0.InterfaceC2242f;
import j3.C2359k;
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import java.util.Set;
import o0.C2631b;
import o0.C2632c;
import p0.AbstractC2686D;
import w4.C3137A;

/* JADX INFO: renamed from: B.c, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class C0053c implements J4.e {

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

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

    public /* synthetic */ C0053c(Object obj, int i6) {
        this.f251a = i6;
        this.f252b = obj;
    }

    /* JADX WARN: Removed duplicated region for block: B:24:0x00b8  */
    /* JADX WARN: Removed duplicated region for block: B:58:0x0181  */
    @Override // J4.e
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object invoke(Object obj, Object obj2) {
        int i6;
        int i7;
        int i8;
        Object next;
        w4.k kVar;
        Object next2;
        boolean zG;
        Y4.c0 c0Var;
        Object value;
        switch (this.f251a) {
            case 0:
                return Integer.valueOf(((C2245i) this.f252b).a(0, ((Integer) obj).intValue(), (h1.m) obj2));
            case 1:
                return Integer.valueOf(((C2246j) this.f252b).a(0, ((Integer) obj).intValue()));
            case 2:
                Composer composer = (Composer) obj;
                int iIntValue = ((Integer) obj2).intValue();
                if (composer.shouldExecute((iIntValue & 3) != 2, iIntValue & 1)) {
                    if (ComposerKt.isTraceInProgress()) {
                        ComposerKt.traceEventStart(-1192950673, iIntValue, -1, "androidx.compose.foundation.layout.FlowRow.<anonymous>.<anonymous> (FlowLayout.kt:113)");
                    }
                    ((ComposableLambda) this.f252b).invoke(C0058e0.f273a, composer, 6);
                    if (ComposerKt.isTraceInProgress()) {
                        ComposerKt.traceEventEnd();
                    }
                } else {
                    composer.skipToGroupEnd();
                }
                return C3137A.f25453a;
            case 3:
                return new h1.j((((long) ((InterfaceC2240d) this.f252b).a(0, (int) (((h1.l) obj).f16627a >> 32), (h1.m) obj2)) << 32) | (((long) 0) & 4294967295L));
            case 4:
                return new h1.j((((long) ((C2246j) ((InterfaceC2241e) this.f252b)).a(0, (int) (((h1.l) obj).f16627a & 4294967295L))) & 4294967295L) | (((long) 0) << 32));
            case 5:
                return new h1.j(((InterfaceC2242f) this.f252b).a(0L, ((h1.l) obj).f16627a, (h1.m) obj2));
            case 6:
                ((InterfaceC0489y0) this.f252b).c(((C2631b) obj2).f21785a);
                return C3137A.f25453a;
            case 7:
                Composer composer2 = (Composer) obj;
                int iIntValue2 = ((Integer) obj2).intValue();
                composer2.startReplaceGroup(666084174);
                if (ComposerKt.isTraceInProgress()) {
                    ComposerKt.traceEventStart(666084174, iIntValue2, -1, "androidx.compose.foundation.text.contextmenu.internal.DefaultTextContextMenuDropdown.<anonymous>.<anonymous>.<anonymous>.<anonymous> (DefaultTextContextMenuDropdownProvider.android.kt:145)");
                }
                String str = ((N.d) this.f252b).f5115b;
                if (ComposerKt.isTraceInProgress()) {
                    ComposerKt.traceEventEnd();
                }
                composer2.endReplaceGroup();
                return str;
            case 8:
                TextClassification textClassification = (TextClassification) this.f252b;
                Composer composer3 = (Composer) obj;
                int iIntValue3 = ((Integer) obj2).intValue();
                composer3.startReplaceGroup(950061013);
                if (ComposerKt.isTraceInProgress()) {
                    ComposerKt.traceEventStart(950061013, iIntValue3, -1, "androidx.compose.foundation.text.contextmenu.internal.TextContextMenuHelperApi28.textClassificationItem.<anonymous> (DefaultTextContextMenuDropdownProvider.android.kt:246)");
                }
                String strValueOf = String.valueOf(textClassification.getLabel());
                if (ComposerKt.isTraceInProgress()) {
                    ComposerKt.traceEventEnd();
                }
                composer3.endReplaceGroup();
                return strValueOf;
            case 9:
                RemoteAction remoteAction = (RemoteAction) this.f252b;
                Composer composer4 = (Composer) obj;
                int iIntValue4 = ((Integer) obj2).intValue();
                composer4.startReplaceGroup(-1376593684);
                if (ComposerKt.isTraceInProgress()) {
                    ComposerKt.traceEventStart(-1376593684, iIntValue4, -1, "androidx.compose.foundation.text.contextmenu.internal.TextContextMenuHelperApi28.textClassificationItem.<anonymous> (DefaultTextContextMenuDropdownProvider.android.kt:254)");
                }
                String string = remoteAction.getTitle().toString();
                if (ComposerKt.isTraceInProgress()) {
                    ComposerKt.traceEventEnd();
                }
                composer4.endReplaceGroup();
                return string;
            case 10:
                CharSequence DelimitedRangesSequence = (CharSequence) obj;
                int iIntValue5 = ((Integer) obj2).intValue();
                kotlin.jvm.internal.o.h(DelimitedRangesSequence, "$this$DelimitedRangesSequence");
                int iP0 = S4.p.P0(DelimitedRangesSequence, (char[]) this.f252b, iIntValue5, false);
                if (iP0 < 0) {
                    return null;
                }
                return new w4.k(Integer.valueOf(iP0), 1);
            case 11:
                CharSequence DelimitedRangesSequence2 = (CharSequence) obj;
                int iIntValue6 = ((Integer) obj2).intValue();
                kotlin.jvm.internal.o.h(DelimitedRangesSequence2, "$this$DelimitedRangesSequence");
                List list = (List) this.f252b;
                if (list.size() == 1) {
                    int size = list.size();
                    if (size == 0) {
                        throw new NoSuchElementException("List is empty.");
                    }
                    if (size != 1) {
                        throw new IllegalArgumentException("List has more than one element.");
                    }
                    String str2 = (String) list.get(0);
                    int iO0 = S4.p.O0(DelimitedRangesSequence2, str2, iIntValue6, false, 4);
                    kVar = iO0 < 0 ? null : new w4.k(Integer.valueOf(iO0), str2);
                } else {
                    if (iIntValue6 < 0) {
                        iIntValue6 = 0;
                    }
                    P4.g gVar = new P4.g(iIntValue6, DelimitedRangesSequence2.length(), 1);
                    boolean z6 = DelimitedRangesSequence2 instanceof String;
                    int i9 = gVar.f5678c;
                    int i10 = gVar.f5677b;
                    if (z6) {
                        if ((i9 > 0 && iIntValue6 <= i10) || (i9 < 0 && i10 <= iIntValue6)) {
                            int i11 = iIntValue6;
                            while (true) {
                                Iterator it = list.iterator();
                                while (true) {
                                    if (it.hasNext()) {
                                        next2 = it.next();
                                        String str3 = (String) next2;
                                        if (S4.w.v0(0, i11, str3.length(), str3, (String) DelimitedRangesSequence2, false)) {
                                        }
                                    } else {
                                        next2 = null;
                                    }
                                }
                                String str4 = (String) next2;
                                if (str4 != null) {
                                    kVar = new w4.k(Integer.valueOf(i11), str4);
                                } else if (i11 != i10) {
                                    i11 += i9;
                                }
                            }
                        }
                    } else if ((i9 > 0 && iIntValue6 <= i10) || (i9 < 0 && i10 <= iIntValue6)) {
                        while (true) {
                            Iterator it2 = list.iterator();
                            while (true) {
                                if (it2.hasNext()) {
                                    next = it2.next();
                                    int i12 = i10;
                                    String str5 = (String) next;
                                    int i13 = i9;
                                    i6 = iIntValue6;
                                    i7 = i13;
                                    i8 = i12;
                                    if (!S4.p.W0(str5, 0, DelimitedRangesSequence2, i6, str5.length(), false)) {
                                        i9 = i7;
                                        iIntValue6 = i6;
                                        i10 = i8;
                                    }
                                } else {
                                    int i14 = i9;
                                    i6 = iIntValue6;
                                    i7 = i14;
                                    i8 = i10;
                                    next = null;
                                }
                            }
                            String str6 = (String) next;
                            if (str6 != null) {
                                kVar = new w4.k(Integer.valueOf(i6), str6);
                            } else if (i6 != i8) {
                                int i15 = i6 + i7;
                                i9 = i7;
                                iIntValue6 = i15;
                                i10 = i8;
                            }
                        }
                    }
                }
                if (kVar != null) {
                    return new w4.k(kVar.f25469a, Integer.valueOf(((String) kVar.f25470b).length()));
                }
                return null;
            case 12:
                C2632c c2632cL = AbstractC2686D.L((RectF) obj);
                C2632c c2632cL2 = AbstractC2686D.L((RectF) obj2);
                switch (((G0.K) this.f252b).f1886a) {
                    case 6:
                        zG = c2632cL.g(c2632cL2);
                        break;
                    default:
                        zG = c2632cL2.a(c2632cL.b());
                        break;
                }
                return Boolean.valueOf(zG);
            case 13:
                ((C0124z) obj).a();
                ((kotlin.jvm.internal.B) this.f252b).f20114a = ((C2631b) obj2).f21785a;
                return C3137A.f25453a;
            case 14:
                int iIntValue7 = ((Integer) obj).intValue();
                A4.h hVar = (A4.h) obj2;
                A4.i key = hVar.getKey();
                A4.h hVar2 = ((Z4.x) this.f252b).f9216b.get(key);
                if (key != C0763h0.f8306a) {
                    iIntValue7 = hVar != hVar2 ? Integer.MIN_VALUE : iIntValue7 + 1;
                } else {
                    InterfaceC0765i0 interfaceC0765i0 = (InterfaceC0765i0) hVar2;
                    InterfaceC0765i0 parent = (InterfaceC0765i0) hVar;
                    while (true) {
                        if (parent == null) {
                            parent = null;
                        } else if (parent != interfaceC0765i0 && (parent instanceof a5.p)) {
                            InterfaceC0778p interfaceC0778p = (InterfaceC0778p) V4.u0.f8338b.get((a5.p) parent);
                            parent = interfaceC0778p != null ? interfaceC0778p.getParent() : null;
                        }
                    }
                    if (parent != interfaceC0765i0) {
                        throw new IllegalStateException(("Flow invariant is violated:\n\t\tEmission from another coroutine is detected.\n\t\tChild of " + parent + ", expected child of " + interfaceC0765i0 + ".\n\t\tFlowCollector is not thread-safe and concurrent emissions are prohibited.\n\t\tTo mitigate this restriction please use 'channelFlow' builder instead of 'flow'").toString());
                    }
                    if (interfaceC0765i0 != null) {
                    }
                }
                return Integer.valueOf(iIntValue7);
            case 15:
                return SnapshotStateObserver.applyObserver$lambda$0((SnapshotStateObserver) this.f252b, (Set) obj, (Snapshot) obj2);
            case 16:
                Long l = (Long) obj2;
                Float fValueOf = (l == null || l.longValue() <= 0) ? null : Float.valueOf(L4.a.u(((Long) obj).longValue() / l.longValue(), 0.0f, 1.0f));
                Y4.H h5 = ((UpdateViewModel) this.f252b)._uiState;
                do {
                    c0Var = (Y4.c0) h5;
                    value = c0Var.getValue();
                } while (!c0Var.i(value, C2359k.a((C2359k) value, false, null, false, false, fValueOf, null, false, false, false, null, AnalyticsListener.EVENT_AUDIO_ENABLED)));
                return C3137A.f25453a;
            default:
                float fFloatValue = ((Float) obj).floatValue();
                float fFloatValue2 = ((Float) obj2).floatValue();
                x.Z0 z02 = (x.Z0) this.f252b;
                V4.E.y(z02.getCoroutineScope(), null, null, new x.X0(z02, fFloatValue, fFloatValue2, null), 3);
                return Boolean.TRUE;
        }
    }
}
