package o;

import android.window.BackEvent;
import android.window.OnBackAnimationCallback;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.zT, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C3094zT implements OnBackAnimationCallback {
    public final /* synthetic */ C2999yT a;

    public C3094zT(C2999yT c2999yT) {
        this.a = c2999yT;
    }

    public final void onBackCancelled() {
        C2999yT c2999yT = this.a;
        C2807wR c2807wR = c2999yT.a;
        if (c2807wR == null) {
            throw new IllegalStateException("This input is not added to any dispatcher.");
        }
        if (!c2999yT.b) {
            c2807wR.c(c2999yT, null);
        }
        C3092zR c3092zR = c2807wR.b;
        if (c2999yT.equals(c3092zR.h) && -1 == c3092zR.g) {
            if (c3092zR.f == null) {
                c3092zR.c(-1);
            }
            c3092zR.f = null;
            c3092zR.g = 0;
            c3092zR.h = null;
            Ba0 ba0 = c3092zR.a;
            AR ar = AR.m;
            ba0.getClass();
            ba0.i(null, ar);
        }
        c2999yT.b = false;
    }

    public final void onBackInvoked() {
        this.a.a();
    }

    public final void onBackProgressed(BackEvent backEvent) {
        C2712vR c2712vRD = AbstractC1155f00.d(backEvent);
        C2999yT c2999yT = this.a;
        C2807wR c2807wR = c2999yT.a;
        if (c2807wR == null) {
            throw new IllegalStateException("This input is not added to any dispatcher.");
        }
        if (c2999yT.b) {
            C3092zR c3092zR = c2807wR.b;
            if (c2999yT.equals(c3092zR.h) && -1 == c3092zR.g) {
                if (c3092zR.f == null) {
                    c3092zR.c(-1);
                }
                Ba0 ba0 = c3092zR.a;
                BR br = new BR(c2712vRD);
                ba0.getClass();
                ba0.i(null, br);
            }
        }
    }

    public final void onBackStarted(BackEvent backEvent) {
        C2712vR c2712vRD = AbstractC1155f00.d(backEvent);
        C2999yT c2999yT = this.a;
        C2807wR c2807wR = c2999yT.a;
        if (c2807wR == null) {
            throw new IllegalStateException("This input is not added to any dispatcher.");
        }
        if (c2999yT.b) {
            return;
        }
        c2807wR.c(c2999yT, c2712vRD);
        c2999yT.b = true;
    }
}
