package d;

import e4.C0574r;

/* JADX INFO: renamed from: d.p, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0522p {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final m0.e f5995a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final C0574r f5996b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final C0574r f5997c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f5998d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public m0.c f5999e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final AbstractC0523q f6000f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public boolean f6001g;

    public C0522p(AbstractC0523q abstractC0523q, m0.e eVar) {
        boolean zIsEnabled = abstractC0523q.isEnabled();
        this.f5995a = eVar;
        C0574r c0574r = C0574r.f6259k;
        this.f5996b = c0574r;
        this.f5997c = c0574r;
        this.f5998d = zIsEnabled;
        this.f6000f = abstractC0523q;
        this.f6001g = true;
    }

    public final void a() {
        m0.c cVar = this.f5999e;
        if (cVar == null || !cVar.f9283c.remove(this)) {
            return;
        }
        m0.g gVar = cVar.f9282b;
        gVar.getClass();
        if (equals(gVar.f9294f)) {
            if (gVar.f9295g == -1) {
                this.f6000f.handleOnBackCancelled();
            }
            gVar.f9294f = null;
            gVar.f9295g = 0;
            gVar.f9296h = null;
        }
        gVar.f9292d.remove(this);
        gVar.f9293e.remove(this);
        this.f5999e = null;
        gVar.b();
    }

    public final void b(boolean z5) {
        m0.g gVar;
        this.f6001g = z5;
        boolean z6 = z5 && this.f6000f.isEnabled();
        if (this.f5998d == z6) {
            return;
        }
        this.f5998d = z6;
        m0.c cVar = this.f5999e;
        if (cVar == null || (gVar = cVar.f9282b) == null) {
            return;
        }
        gVar.b();
    }
}
