package h3;

import android.view.KeyEvent;
import androidx.compose.runtime.MutableState;
import w4.C3137A;

/* JADX INFO: loaded from: classes.dex */
public final class G0 implements J4.c {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ J4.a f16826b;

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

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

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

    public G0(J4.a aVar, J4.a aVar2, MutableState mutableState, MutableState mutableState2) {
        this.f16826b = aVar;
        this.f16829e = aVar2;
        this.f16827c = mutableState;
        this.f16828d = mutableState2;
    }

    /* JADX WARN: Multi-variable type inference failed */
    @Override // J4.c
    public final Object invoke(Object obj) {
        J4.a aVar = this.f16826b;
        MutableState mutableState = this.f16828d;
        Object obj2 = this.f16829e;
        MutableState mutableState2 = this.f16827c;
        switch (this.f16825a) {
            case 0:
                KeyEvent event = ((A0.c) obj).f76a;
                kotlin.jvm.internal.o.h(event, "event");
                if (A0.d.c(event) != 2) {
                    return Boolean.FALSE;
                }
                boolean z6 = true;
                if (((Boolean) mutableState2.getValue()).booleanValue() && event.getKeyCode() == 4) {
                    mutableState.setValue(Boolean.TRUE);
                    mutableState2.setValue(Boolean.FALSE);
                } else if (!((Boolean) mutableState2.getValue()).booleanValue() && event.getKeyCode() == 20) {
                    aVar.invoke();
                } else if (((Boolean) mutableState2.getValue()).booleanValue() || event.getKeyCode() != 4) {
                    z6 = false;
                } else {
                    ((J4.a) obj2).invoke();
                }
                return Boolean.valueOf(z6);
            default:
                n0.B it = (n0.B) obj;
                kotlin.jvm.internal.o.h(it, "it");
                n0.C c6 = (n0.C) it;
                boolean zB = c6.b();
                float f6 = T2.f17380a;
                mutableState2.setValue(Boolean.valueOf(zB));
                boolean zB2 = c6.b();
                String str = ((C2099d2) obj2).f17848a;
                if (zB2) {
                    mutableState.setValue(str);
                    aVar.invoke();
                } else if (kotlin.jvm.internal.o.c((String) mutableState.getValue(), str)) {
                    mutableState.setValue(null);
                }
                return C3137A.f25453a;
        }
    }

    public G0(C2099d2 c2099d2, J4.a aVar, MutableState mutableState, MutableState mutableState2) {
        this.f16829e = c2099d2;
        this.f16826b = aVar;
        this.f16827c = mutableState;
        this.f16828d = mutableState2;
    }
}
