package hc;

import android.util.SparseIntArray;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.databinding.n;
import ca.canadapost.core.data.flex.model.FlexLocation;
import gc.a2;
import ic.a;

/* loaded from: classes4.dex */
public class t extends s implements a.InterfaceC0487a {
    private static final n.i L = null;
    private static final SparseIntArray M;
    private final LinearLayout F;
    private final LinearLayout G;
    private final TextView H;
    private final TextView I;
    private final View.OnClickListener J;
    private long K;

    static {
        SparseIntArray sparseIntArray = new SparseIntArray();
        M = sparseIntArray;
        sparseIntArray.put(a2.f19542l, 5);
        sparseIntArray.put(a2.f19556z, 6);
        sparseIntArray.put(a2.F, 7);
    }

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

    private boolean V(androidx.lifecycle.a0 a0Var, int i10) {
        if (i10 != gc.e.f19609a) {
            return false;
        }
        synchronized (this) {
            this.K |= 2;
        }
        return true;
    }

    private boolean W(androidx.lifecycle.a0 a0Var, int i10) {
        if (i10 != gc.e.f19609a) {
            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.a0) obj, i11);
        }
        if (i10 != 1) {
            return false;
        }
        return V((androidx.lifecycle.a0) obj, i11);
    }

    @Override // androidx.databinding.n
    public boolean Q(int i10, Object obj) {
        if (gc.e.f19610b != i10) {
            return false;
        }
        U((ca.canadapost.module.flex.d) obj);
        return true;
    }

    @Override // hc.s
    public void U(ca.canadapost.module.flex.d dVar) {
        this.E = dVar;
        synchronized (this) {
            this.K |= 4;
        }
        f(gc.e.f19610b);
        super.J();
    }

    @Override // ic.a.InterfaceC0487a
    public final void a(int i10, View view) {
        ca.canadapost.module.flex.d dVar = this.E;
        if (dVar != null) {
            dVar.W0();
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:16:0x0038  */
    @Override // androidx.databinding.n
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    protected void n() {
        long j10;
        String str;
        String str2;
        synchronized (this) {
            j10 = this.K;
            this.K = 0L;
        }
        ca.canadapost.module.flex.d dVar = this.E;
        String str3 = null;
        if ((15 & j10) != 0) {
            if ((j10 & 13) != 0) {
                androidx.lifecycle.a0 v02 = dVar != null ? dVar.v0() : null;
                S(0, v02);
                if (v02 != null) {
                    str2 = (String) v02.f();
                    if ((j10 & 14) != 0) {
                        androidx.lifecycle.a0 u02 = dVar != null ? dVar.u0() : null;
                        S(1, u02);
                        FlexLocation.FlexLocationItem flexLocationItem = u02 != null ? (FlexLocation.FlexLocationItem) u02.f() : null;
                        if (flexLocationItem != null) {
                            String name = flexLocationItem.getName();
                            str3 = flexLocationItem.getLocation();
                            str = name;
                        }
                    }
                    str = null;
                }
            }
            str2 = null;
            if ((j10 & 14) != 0) {
            }
            str = null;
        } else {
            str = null;
            str2 = null;
        }
        if ((8 & j10) != 0) {
            this.G.setOnClickListener(this.J);
        }
        if ((14 & j10) != 0) {
            b4.e.e(this.H, str3);
            b4.e.e(this.I, str);
        }
        if ((j10 & 13) != 0) {
            b4.e.e(this.D, str2);
        }
    }

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

    private t(androidx.databinding.e eVar, View view, Object[] objArr) {
        super(eVar, view, 2, (ImageView) objArr[5], (Button) objArr[6], (Button) objArr[7], (TextView) objArr[2]);
        this.K = -1L;
        LinearLayout linearLayout = (LinearLayout) objArr[0];
        this.F = linearLayout;
        linearLayout.setTag(null);
        LinearLayout linearLayout2 = (LinearLayout) objArr[1];
        this.G = linearLayout2;
        linearLayout2.setTag(null);
        TextView textView = (TextView) objArr[3];
        this.H = textView;
        textView.setTag(null);
        TextView textView2 = (TextView) objArr[4];
        this.I = textView2;
        textView2.setTag(null);
        this.D.setTag(null);
        P(view);
        this.J = new ic.a(this, 1);
        B();
    }
}
