package od;

import android.util.SparseIntArray;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import androidx.databinding.n;
import ca.canadapost.core.common.customView.CpcTextInput;
import ca.canadapost.core.common.ui.CpcFragmentContainerView;
import ud.a;

/* loaded from: classes4.dex */
public class h extends g implements a.InterfaceC0889a {
    private static final n.i L = null;
    private static final SparseIntArray M = null;
    private final CpcFragmentContainerView F;
    private final TextView G;
    private final View.OnClickListener H;
    private final View.OnClickListener I;
    private androidx.databinding.g J;
    private long K;

    /* loaded from: classes4.dex */
    class a implements androidx.databinding.g {
        a() {
        }

        @Override // androidx.databinding.g
        public void a() {
            String a10 = ca.canadapost.core.common.customView.u.a(h.this.A);
            xd.b bVar = h.this.E;
            if (bVar != null) {
                androidx.lifecycle.f0 W = bVar.W();
                if (W != null) {
                    W.q(a10);
                }
            }
        }
    }

    public h(androidx.databinding.e eVar, View view) {
        this(eVar, view, androidx.databinding.n.E(eVar, view, 6, L, M));
    }

    private boolean U(androidx.lifecycle.f0 f0Var, int i10) {
        if (i10 != ld.a.f27861a) {
            return false;
        }
        synchronized (this) {
            this.K |= 1;
        }
        return true;
    }

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

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

    @Override // androidx.databinding.n
    public boolean Q(int i10, Object obj) {
        if (ld.a.f27862b != i10) {
            return false;
        }
        V((xd.b) obj);
        return true;
    }

    public void V(xd.b bVar) {
        this.E = bVar;
        synchronized (this) {
            this.K |= 2;
        }
        f(ld.a.f27862b);
        super.J();
    }

    @Override // ud.a.InterfaceC0889a
    public final void a(int i10, View view) {
        if (i10 == 1) {
            xd.b bVar = this.E;
            if (bVar != null) {
                bVar.e0();
                return;
            }
            return;
        }
        if (i10 != 2) {
            return;
        }
        xd.b bVar2 = this.E;
        if (bVar2 != null) {
            bVar2.d0();
        }
    }

    @Override // androidx.databinding.n
    protected void n() {
        long j10;
        String str;
        synchronized (this) {
            j10 = this.K;
            this.K = 0L;
        }
        xd.b bVar = this.E;
        long j11 = 7 & j10;
        boolean z10 = false;
        androidx.lifecycle.f0 f0Var = null;
        r9 = null;
        String str2 = null;
        if (j11 != 0) {
            androidx.lifecycle.f0 W = bVar != null ? bVar.W() : null;
            S(0, W);
            if (W != null) {
            }
            if ((j10 & 6) != 0 && bVar != null) {
                z10 = bVar.Z();
                str2 = bVar.V();
            }
            str = str2;
            f0Var = W;
        } else {
            str = null;
        }
        if (j11 != 0) {
            ca.canadapost.core.common.customView.u.b(this.A, f0Var);
        }
        if ((4 & j10) != 0) {
            ca.canadapost.core.common.customView.u.e(this.A, this.J);
            this.C.setOnClickListener(this.I);
            this.D.setOnClickListener(this.H);
        }
        if ((j10 & 6) != 0) {
            u7.g.k(this.G, Boolean.valueOf(z10));
            b4.e.e(this.B, str);
        }
    }

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

    private h(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 1, (CpcTextInput) objArr[3], (TextView) objArr[2], (Button) objArr[5], (Button) objArr[4]);
        this.J = new a();
        this.K = -1L;
        this.A.setTag(null);
        CpcFragmentContainerView cpcFragmentContainerView = (CpcFragmentContainerView) objArr[0];
        this.F = cpcFragmentContainerView;
        cpcFragmentContainerView.setTag(null);
        TextView textView = (TextView) objArr[1];
        this.G = textView;
        textView.setTag(null);
        this.B.setTag(null);
        this.C.setTag(null);
        this.D.setTag(null);
        P(view);
        this.H = new ud.a(this, 1);
        this.I = new ud.a(this, 2);
        B();
    }
}
