package zb;

import android.util.SparseIntArray;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.databinding.n;
import bc.b;
import ca.canadapost.core.common.customView.CpcDropdownInput;
import ca.canadapost.core.common.customView.CpcTextInput;

/* loaded from: classes4.dex */
public class z0 extends y0 implements b.a {
    private static final n.i L = null;
    private static final SparseIntArray M;
    private final LinearLayout F;
    private final TextView G;
    private final View.OnClickListener H;
    private androidx.databinding.g 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(z0.this.A);
            cc.s sVar = z0.this.E;
            if (sVar != null) {
                androidx.lifecycle.f0 t02 = sVar.t0();
                if (t02 != null) {
                    t02.q(a10);
                }
            }
        }
    }

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

        @Override // androidx.databinding.g
        public void a() {
            String a10 = ca.canadapost.core.common.customView.u.a(z0.this.B);
            cc.s sVar = z0.this.E;
            if (sVar != null) {
                androidx.lifecycle.f0 u02 = sVar.u0();
                if (u02 != null) {
                    u02.q(a10);
                }
            }
        }
    }

    static {
        SparseIntArray sparseIntArray = new SparseIntArray();
        M = sparseIntArray;
        sparseIntArray.put(ob.i.F0, 4);
        sparseIntArray.put(ob.i.G0, 5);
    }

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

    private boolean V(androidx.lifecycle.f0 f0Var, int i10) {
        if (i10 != ob.a.f31092a) {
            return false;
        }
        synchronized (this) {
            this.K |= 2;
        }
        return true;
    }

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

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

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

    @Override // androidx.databinding.n
    public boolean Q(int i10, Object obj) {
        if (ob.a.f31095d != i10) {
            return false;
        }
        U((cc.s) obj);
        return true;
    }

    @Override // zb.y0
    public void U(cc.s sVar) {
        this.E = sVar;
        synchronized (this) {
            this.K |= 4;
        }
        f(ob.a.f31095d);
        super.J();
    }

    @Override // bc.b.a
    public final void a(int i10, View view) {
        cc.s sVar = this.E;
        if (sVar != null) {
            sVar.z0();
        }
    }

    @Override // androidx.databinding.n
    protected void n() {
        long j10;
        androidx.lifecycle.f0 f0Var;
        synchronized (this) {
            j10 = this.K;
            this.K = 0L;
        }
        cc.s sVar = this.E;
        if ((15 & j10) != 0) {
            if ((j10 & 13) != 0) {
                f0Var = sVar != null ? sVar.u0() : null;
                S(0, f0Var);
                if (f0Var != null) {
                }
            } else {
                f0Var = null;
            }
            if ((j10 & 14) != 0) {
                r10 = sVar != null ? sVar.t0() : null;
                S(1, r10);
                if (r10 != null) {
                }
            }
        } else {
            f0Var = null;
        }
        if ((8 & j10) != 0) {
            this.G.setOnClickListener(this.H);
            ca.canadapost.core.common.customView.u.e(this.A, this.I);
            ca.canadapost.core.common.customView.u.e(this.B, this.J);
        }
        if ((14 & j10) != 0) {
            ca.canadapost.core.common.customView.u.b(this.A, r10);
        }
        if ((j10 & 13) != 0) {
            ca.canadapost.core.common.customView.u.b(this.B, f0Var);
        }
    }

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

    private z0(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 2, (CpcTextInput) objArr[1], (CpcTextInput) objArr[2], (CpcDropdownInput) objArr[4], (CpcDropdownInput) objArr[5]);
        this.I = new a();
        this.J = new b();
        this.K = -1L;
        LinearLayout linearLayout = (LinearLayout) objArr[0];
        this.F = linearLayout;
        linearLayout.setTag(null);
        TextView textView = (TextView) objArr[3];
        this.G = textView;
        textView.setTag(null);
        this.A.setTag(null);
        this.B.setTag(null);
        P(view);
        this.H = new bc.b(this, 1);
        B();
    }
}
