package ae;

import android.util.SparseIntArray;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.databinding.n;
import ca.canadapost.core.common.ui.CpcFragmentContainerFullView;
import ca.canadapost.core.data.mymail.model.MyMailCommercialDetailsUIModel;
import de.a;

/* loaded from: classes4.dex */
public class v extends u implements a.InterfaceC0350a {
    private static final n.i L = null;
    private static final SparseIntArray M;
    private final CpcFragmentContainerFullView I;
    private final View.OnClickListener J;
    private long K;

    static {
        SparseIntArray sparseIntArray = new SparseIntArray();
        M = sparseIntArray;
        sparseIntArray.put(yd.i.f52298n, 7);
    }

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

    private boolean U(androidx.lifecycle.a0 a0Var, int i10) {
        if (i10 != yd.a.f52233a) {
            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.a0) obj, i11);
    }

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

    public void V(zd.b bVar) {
        this.H = bVar;
        synchronized (this) {
            this.K |= 2;
        }
        f(yd.a.f52234b);
        super.J();
    }

    @Override // de.a.InterfaceC0350a
    public final void a(int i10, View view) {
        zd.b bVar = this.H;
        if (bVar != null) {
            bVar.n0();
        }
    }

    @Override // androidx.databinding.n
    protected void n() {
        long j10;
        String str;
        String str2;
        String str3;
        String str4;
        String str5;
        String str6;
        boolean z10;
        synchronized (this) {
            j10 = this.K;
            this.K = 0L;
        }
        zd.b bVar = this.H;
        long j11 = 7 & j10;
        boolean z11 = false;
        if (j11 != 0) {
            if ((j10 & 6) != 0) {
                MyMailCommercialDetailsUIModel k02 = bVar != null ? bVar.k0() : null;
                if (k02 != null) {
                    str3 = k02.getTitle();
                    str4 = k02.getAdImageURL();
                    str5 = k02.getMailerName();
                    str6 = k02.getButtonText();
                    str2 = k02.getDescription();
                } else {
                    str2 = null;
                    str3 = null;
                    str4 = null;
                    str5 = null;
                    str6 = null;
                }
                z10 = str6 != null;
            } else {
                z10 = false;
                str2 = null;
                str3 = null;
                str4 = null;
                str5 = null;
                str6 = null;
            }
            androidx.lifecycle.a0 i02 = bVar != null ? bVar.i0() : null;
            S(0, i02);
            if (i02 != null) {
                str = (String) i02.f();
                z11 = z10;
            } else {
                z11 = z10;
                str = null;
            }
        } else {
            str = null;
            str2 = null;
            str3 = null;
            str4 = null;
            str5 = null;
            str6 = null;
        }
        if ((j10 & 4) != 0) {
            this.B.setOnClickListener(this.J);
        }
        if ((j10 & 6) != 0) {
            b4.e.e(this.B, str6);
            u7.g.k(this.B, Boolean.valueOf(z11));
            b4.e.e(this.C, str2);
            u7.g.d(this.D, str4, null);
            b4.e.e(this.F, str3);
            b4.e.e(this.G, str5);
        }
        if (j11 != 0) {
            ImageView imageView = this.E;
            u7.g.d(imageView, str, j.a.b(imageView.getContext(), yd.h.f52271a));
        }
    }

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

    private v(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 1, (WebView) objArr[7], (Button) objArr[6], (TextView) objArr[4], (ImageView) objArr[5], (ImageView) objArr[1], (TextView) objArr[3], (TextView) objArr[2]);
        this.K = -1L;
        this.B.setTag(null);
        this.C.setTag(null);
        this.D.setTag(null);
        this.E.setTag(null);
        CpcFragmentContainerFullView cpcFragmentContainerFullView = (CpcFragmentContainerFullView) objArr[0];
        this.I = cpcFragmentContainerFullView;
        cpcFragmentContainerFullView.setTag(null);
        this.F.setTag(null);
        this.G.setTag(null);
        P(view);
        this.J = new de.a(this, 1);
        B();
    }
}
