package d;

import java.util.ListIterator;
import w4.C3137A;
import x4.C3249o;

/* JADX INFO: renamed from: d.v, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1843v extends kotlin.jvm.internal.p implements J4.c {

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

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

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ C1843v(C1818B c1818b, int i6) {
        super(1);
        this.f14501a = i6;
        this.f14502b = c1818b;
    }

    @Override // J4.c
    public final Object invoke(Object obj) {
        Object objPrevious;
        Object objPrevious2;
        switch (this.f14501a) {
            case 0:
                C1822a backEvent = (C1822a) obj;
                kotlin.jvm.internal.o.h(backEvent, "backEvent");
                C1818B c1818b = this.f14502b;
                C3249o c3249o = c1818b.f14457b;
                ListIterator listIterator = c3249o.listIterator(c3249o.size());
                while (true) {
                    if (listIterator.hasPrevious()) {
                        objPrevious = listIterator.previous();
                        if (((AbstractC1842u) objPrevious).f14498a) {
                        }
                    } else {
                        objPrevious = null;
                    }
                }
                AbstractC1842u abstractC1842u = (AbstractC1842u) objPrevious;
                if (c1818b.f14458c != null) {
                    c1818b.b();
                }
                c1818b.f14458c = abstractC1842u;
                if (abstractC1842u != null) {
                    abstractC1842u.d(backEvent);
                }
                break;
            default:
                C1822a backEvent2 = (C1822a) obj;
                kotlin.jvm.internal.o.h(backEvent2, "backEvent");
                C1818B c1818b2 = this.f14502b;
                AbstractC1842u abstractC1842u2 = c1818b2.f14458c;
                if (abstractC1842u2 == null) {
                    C3249o c3249o2 = c1818b2.f14457b;
                    ListIterator listIterator2 = c3249o2.listIterator(c3249o2.size());
                    while (true) {
                        if (listIterator2.hasPrevious()) {
                            objPrevious2 = listIterator2.previous();
                            if (((AbstractC1842u) objPrevious2).f14498a) {
                            }
                        } else {
                            objPrevious2 = null;
                        }
                    }
                    abstractC1842u2 = (AbstractC1842u) objPrevious2;
                }
                if (abstractC1842u2 != null) {
                    abstractC1842u2.c(backEvent2);
                }
                break;
        }
        return C3137A.f25453a;
    }
}
