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 r extends q implements a.InterfaceC0889a {
    private static final n.i N = null;
    private static final SparseIntArray O = null;
    private final CpcFragmentContainerView F;
    private final Button G;
    private final View.OnClickListener H;
    private final View.OnClickListener I;
    private final View.OnClickListener J;
    private androidx.databinding.g K;
    private androidx.databinding.g L;
    private long M;

    /* 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(r.this.A);
            qd.a aVar = r.this.E;
            if (aVar != null) {
                androidx.lifecycle.f0 W = aVar.W();
                if (W != null) {
                    W.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(r.this.B);
            qd.a aVar = r.this.E;
            if (aVar != null) {
                androidx.lifecycle.f0 a02 = aVar.a0();
                if (a02 != null) {
                    a02.q(a10);
                }
            }
        }
    }

    public r(androidx.databinding.e eVar, View view) {
        this(eVar, view, androidx.databinding.n.E(eVar, view, 6, N, O));
    }

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

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

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

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

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

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

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

    public void Y(qd.a aVar) {
        this.E = aVar;
        synchronized (this) {
            this.M |= 16;
        }
        f(ld.a.f27862b);
        super.J();
    }

    @Override // ud.a.InterfaceC0889a
    public final void a(int i10, View view) {
        if (i10 == 1) {
            qd.a aVar = this.E;
            if (aVar != null) {
                aVar.h0();
                return;
            }
            return;
        }
        if (i10 == 2) {
            qd.a aVar2 = this.E;
            if (aVar2 != null) {
                aVar2.l0();
                return;
            }
            return;
        }
        if (i10 != 3) {
            return;
        }
        qd.a aVar3 = this.E;
        if (aVar3 != null) {
            aVar3.g0();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:31:0x007f  */
    /* JADX WARN: Removed duplicated region for block: B:38:0x009d A[ADDED_TO_REGION] */
    @Override // androidx.databinding.n
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    protected void n() {
        long j10;
        String str;
        androidx.lifecycle.f0 f0Var;
        String str2;
        String str3;
        long j11;
        androidx.lifecycle.f0 f0Var2;
        synchronized (this) {
            j10 = this.M;
            this.M = 0L;
        }
        qd.a aVar = this.E;
        String str4 = null;
        if ((63 & j10) != 0) {
            if ((j10 & 49) != 0) {
                f0Var = aVar != null ? aVar.W() : null;
                S(0, f0Var);
                if (f0Var != null) {
                }
            } else {
                f0Var = null;
            }
            if ((j10 & 50) != 0) {
                f0Var2 = aVar != null ? aVar.a0() : null;
                S(1, f0Var2);
                if (f0Var2 != null) {
                }
            } else {
                f0Var2 = null;
            }
            if ((j10 & 52) != 0) {
                androidx.lifecycle.a0 d02 = aVar != null ? aVar.d0() : null;
                S(2, d02);
                if (d02 != null) {
                    str3 = (String) d02.f();
                    if ((j10 & 56) != 0) {
                        androidx.lifecycle.a0 X = aVar != null ? aVar.X() : null;
                        S(3, X);
                        if (X != null) {
                            str2 = (String) X.f();
                            if ((j10 & 48) != 0 && aVar != null) {
                                str4 = aVar.Y();
                            }
                            str = str4;
                            j11 = 49;
                        }
                    }
                    str2 = null;
                    if ((j10 & 48) != 0) {
                        str4 = aVar.Y();
                    }
                    str = str4;
                    j11 = 49;
                }
            }
            str3 = null;
            if ((j10 & 56) != 0) {
            }
            str2 = null;
            if ((j10 & 48) != 0) {
            }
            str = str4;
            j11 = 49;
        } else {
            str = null;
            f0Var = null;
            str2 = null;
            str3 = null;
            j11 = 49;
            f0Var2 = null;
        }
        if ((j10 & j11) != 0) {
            ca.canadapost.core.common.customView.u.b(this.A, f0Var);
        }
        if ((j10 & 32) != 0) {
            ca.canadapost.core.common.customView.u.e(this.A, this.K);
            this.G.setOnClickListener(this.H);
            ca.canadapost.core.common.customView.u.e(this.B, this.L);
            ca.canadapost.core.common.customView.u.c(this.B, this.I);
            this.D.setOnClickListener(this.J);
        }
        if ((j10 & 56) != 0) {
            ca.canadapost.core.common.customView.u.d(this.A, str2);
        }
        if ((50 & j10) != 0) {
            ca.canadapost.core.common.customView.u.b(this.B, f0Var2);
        }
        if ((52 & j10) != 0) {
            ca.canadapost.core.common.customView.u.d(this.B, str3);
        }
        if ((j10 & 48) != 0) {
            b4.e.e(this.C, str);
        }
    }

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

    private r(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 4, (CpcTextInput) objArr[2], (CpcTextInput) objArr[4], (TextView) objArr[1], (Button) objArr[5]);
        this.K = new a();
        this.L = new b();
        this.M = -1L;
        this.A.setTag(null);
        CpcFragmentContainerView cpcFragmentContainerView = (CpcFragmentContainerView) objArr[0];
        this.F = cpcFragmentContainerView;
        cpcFragmentContainerView.setTag(null);
        Button button = (Button) objArr[3];
        this.G = button;
        button.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);
        this.J = new ud.a(this, 3);
        B();
    }
}
