package bf;

import android.content.res.Resources;
import android.util.SparseIntArray;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.databinding.n;
import androidx.lifecycle.a0;
import ca.canadapost.core.common.ui.CpcFragmentContainerView;
import ef.a;
import w8.d0;

/* loaded from: classes4.dex */
public class h extends g implements a.InterfaceC0370a {
    private static final n.i O = null;
    private static final SparseIntArray P;
    private final CpcFragmentContainerView J;
    private final View.OnClickListener K;
    private final View.OnClickListener L;
    private final View.OnClickListener M;
    private long N;

    static {
        SparseIntArray sparseIntArray = new SparseIntArray();
        P = sparseIntArray;
        sparseIntArray.put(af.c.F, 7);
        sparseIntArray.put(af.c.Q, 8);
    }

    public h(androidx.databinding.e eVar, View view) {
        this(eVar, view, androidx.databinding.n.E(eVar, view, 9, O, P));
    }

    private boolean U(a0 a0Var, int i10) {
        if (i10 != af.a.f316a) {
            return false;
        }
        synchronized (this) {
            this.N |= 1;
        }
        return true;
    }

    @Override // androidx.databinding.n
    public void B() {
        synchronized (this) {
            this.N = 4L;
        }
        J();
    }

    @Override // androidx.databinding.n
    protected boolean F(int i10, Object obj, int i11) {
        if (i10 != 0) {
            return false;
        }
        return U((a0) obj, i11);
    }

    @Override // androidx.databinding.n
    public boolean Q(int i10, Object obj) {
        if (af.a.f317b != i10) {
            return false;
        }
        V((df.c) obj);
        return true;
    }

    public void V(df.c cVar) {
        this.I = cVar;
        synchronized (this) {
            this.N |= 2;
        }
        f(af.a.f317b);
        super.J();
    }

    @Override // ef.a.InterfaceC0370a
    public final void a(int i10, View view) {
        if (i10 == 1) {
            df.c cVar = this.I;
            if (cVar != null) {
                cVar.Z();
                return;
            }
            return;
        }
        if (i10 == 2) {
            df.c cVar2 = this.I;
            if (cVar2 != null) {
                cVar2.X();
                return;
            }
            return;
        }
        if (i10 != 3) {
            return;
        }
        df.c cVar3 = this.I;
        if (cVar3 != null) {
            cVar3.Y();
        }
    }

    @Override // androidx.databinding.n
    protected void n() {
        long j10;
        synchronized (this) {
            j10 = this.N;
            this.N = 0L;
        }
        df.c cVar = this.I;
        long j11 = j10 & 7;
        String str = null;
        if (j11 != 0) {
            a0 W = cVar != null ? cVar.W() : null;
            S(0, W);
            boolean M = androidx.databinding.n.M(W != null ? (Boolean) W.f() : null);
            boolean z10 = !M;
            r8 = M;
            if (j11 != 0) {
                j10 |= r8 ? 16L : 8L;
            }
            Resources resources = this.D.getResources();
            int i10 = r8 ? af.f.f363c : af.f.f364d;
            r8 = z10;
            str = resources.getString(i10);
        }
        if ((4 & j10) != 0) {
            this.A.setOnClickListener(this.K);
            this.E.setOnClickListener(this.M);
            d0.p(this.H, this.L);
        }
        if ((j10 & 7) != 0) {
            u7.g.k(this.C, Boolean.valueOf(r8));
            b4.e.e(this.D, str);
            u7.g.k(this.E, Boolean.valueOf(r8));
            u7.g.k(this.F, Boolean.valueOf(r8));
        }
    }

    @Override // androidx.databinding.n
    public boolean z() {
        synchronized (this) {
            return this.N != 0;
        }
    }

    private h(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 1, (Button) objArr[5], (ImageView) objArr[7], (View) objArr[2], (TextView) objArr[1], (Button) objArr[4], (TextView) objArr[3], (TextView) objArr[8], (TextView) objArr[6]);
        this.N = -1L;
        this.A.setTag(null);
        CpcFragmentContainerView cpcFragmentContainerView = (CpcFragmentContainerView) objArr[0];
        this.J = cpcFragmentContainerView;
        cpcFragmentContainerView.setTag(null);
        this.C.setTag(null);
        this.D.setTag(null);
        this.E.setTag(null);
        this.F.setTag(null);
        this.H.setTag(null);
        P(view);
        this.K = new ef.a(this, 2);
        this.L = new ef.a(this, 3);
        this.M = new ef.a(this, 1);
        B();
    }
}
