package com.ss.android.ugc.aweme.ecommerce.pdp.vh;

import X.0CB;
import X.0CH;
import X.2i8;
import X.3SB;
import X.4ZZ;
import X.4r1;
import X.6Is;
import X.BJ3;
import X.BTH;
import X.C4911Br9;
import X.C4912BrA;
import X.C4913BrB;
import X.C5393Byv;
import X.C5930CIc;
import X.Crj;
import X.M12;
import X.QJt;
import X.Qeg;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.lighten.loader.SmartImageView;
import com.ss.android.ugc.aweme.ecommerce.pdp.IPdpStarter;
import com.ss.android.ugc.aweme.ecommerce.pdp.PdpViewModel;
import java.util.HashMap;
import java.util.LinkedHashMap;
import kotlin.h.b.n;

public final class ShopProfileVH extends AbsFullSpanVH<C4912BrA> implements 6Is {
    public final Qeg LJFF = this.itemView.findViewById(2131370290);
    public final Qeg LJI = this.itemView.findViewById(2131368859);
    public final SmartImageView LJIIIZ = this.itemView.findViewById(2131370288);
    public final LinearLayout LJIIJ = ((LinearLayout) this.itemView.findViewById(2131370293));
    public final Qeg LJIIJJI = this.itemView.findViewById(2131370294);
    public final 4ZZ LJIIL = this.itemView.findViewById(2131370296);
    public final Crj LJIILIIL;

    static {
        Covode.recordClassIndex(71684);
    }

    public final PdpViewModel LJIILIIL() {
        return (PdpViewModel) this.LJIILIIL.getValue();
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        super.onStateChanged(r1, r2);
    }

    public final void LJI() {
        LIZ(new C5930CIc(LJIIJJI(), (byte) 0));
        ShopProfileVH.super.LJI();
    }

    /* JADX WARNING: Illegal instructions before constructor call */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public ShopProfileVH(android.view.ViewGroup r4) {
        /*
            r3 = this;
            X.M12.LIZ(r4)
            android.content.Context r2 = r4.getContext()
            r1 = 2131559148(0x7f0d02ec, float:1.8743632E38)
            r0 = 0
            android.view.View r1 = X.C6489CbV.LIZ(r2, r1, r4, r0)
            java.lang.String r0 = ""
            kotlin.h.b.n.LIZIZ(r1, r0)
            r3.<init>(r1)
            android.view.View r1 = r3.itemView
            r0 = 2131370290(0x7f0a2132, float:1.8360582E38)
            android.view.View r0 = r1.findViewById(r0)
            X.Qeg r0 = (X.Qeg) r0
            r3.LJFF = r0
            android.view.View r1 = r3.itemView
            r0 = 2131368859(0x7f0a1b9b, float:1.835768E38)
            android.view.View r0 = r1.findViewById(r0)
            X.Qeg r0 = (X.Qeg) r0
            r3.LJI = r0
            android.view.View r1 = r3.itemView
            r0 = 2131370288(0x7f0a2130, float:1.8360578E38)
            android.view.View r0 = r1.findViewById(r0)
            com.bytedance.lighten.loader.SmartImageView r0 = (com.bytedance.lighten.loader.SmartImageView) r0
            r3.LJIIIZ = r0
            android.view.View r1 = r3.itemView
            r0 = 2131370293(0x7f0a2135, float:1.8360588E38)
            android.view.View r0 = r1.findViewById(r0)
            android.widget.LinearLayout r0 = (android.widget.LinearLayout) r0
            r3.LJIIJ = r0
            android.view.View r1 = r3.itemView
            r0 = 2131370294(0x7f0a2136, float:1.836059E38)
            android.view.View r0 = r1.findViewById(r0)
            X.Qeg r0 = (X.Qeg) r0
            r3.LJIIJJI = r0
            android.view.View r1 = r3.itemView
            r0 = 2131370296(0x7f0a2138, float:1.8360595E38)
            android.view.View r0 = r1.findViewById(r0)
            X.4ZZ r0 = (X.4ZZ) r0
            r3.LJIIL = r0
            java.lang.Class<com.ss.android.ugc.aweme.ecommerce.pdp.PdpViewModel> r1 = com.ss.android.ugc.aweme.ecommerce.pdp.PdpViewModel.class
            X.KEN r0 = X.KEM.LIZ
            X.D1G r1 = r0.LIZ(r1)
            X.BHS r0 = new X.BHS
            r0.<init>(r3, r1, r1)
            X.Crj r0 = X.7he.LIZ(r0)
            r3.LJIILIIL = r0
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.ecommerce.pdp.vh.ShopProfileVH.<init>(android.view.ViewGroup):void");
    }

    public final /* synthetic */ void LIZ(Object obj) {
        long j;
        String string;
        int i;
        Object obj2;
        HashMap<String, Object> trackParams;
        HashMap<String, Object> trackParams2;
        MethodCollector.i(52);
        C4912BrA brA = (C4912BrA) obj;
        M12.LIZ(brA);
        QJt LIZ = C5393Byv.LIZIZ.LIZ((Object) brA.LIZIZ);
        LIZ.LIZ("ShopProfileVH");
        View view = this.itemView;
        n.LIZIZ(view, "");
        Context context = view.getContext();
        n.LIZIZ(context, "");
        LIZ.LJIL = C4911Br9.LIZ(context);
        LIZ.LJJIIZ = this.LJIIIZ;
        LIZ.LIZJ();
        Qeg qeg = this.LJFF;
        n.LIZIZ(qeg, "");
        qeg.setText(brA.LIZJ);
        Long l = brA.LIZLLL;
        if (l != null) {
            j = l.longValue();
        } else {
            j = 0;
        }
        if (j > 1) {
            View view2 = this.itemView;
            n.LIZIZ(view2, "");
            Context context2 = view2.getContext();
            n.LIZIZ(context2, "");
            string = context2.getResources().getString(2131824204, new Object[]{Long.valueOf(j)});
        } else {
            View view3 = this.itemView;
            n.LIZIZ(view3, "");
            Context context3 = view3.getContext();
            n.LIZIZ(context3, "");
            string = context3.getResources().getString(2131824177, new Object[]{Long.valueOf(j)});
        }
        n.LIZIZ(string, "");
        Qeg qeg2 = this.LJI;
        n.LIZIZ(qeg2, "");
        qeg2.setText(string);
        String str = brA.LJ;
        Float LIZJ = 2i8.LIZJ(str);
        if (LIZJ == null || LIZJ.floatValue() <= 0.0f) {
            LinearLayout linearLayout = this.LJIIJ;
            n.LIZIZ(linearLayout, "");
            ViewGroup viewGroup = (ViewGroup) linearLayout.getParent();
            if (viewGroup != null) {
                viewGroup.removeView(this.LJIIJ);
            }
        } else {
            float floatValue = LIZJ.floatValue();
            LinearLayout linearLayout2 = this.LJIIJ;
            n.LIZIZ(linearLayout2, "");
            linearLayout2.setBackground((Drawable) null);
            Qeg qeg3 = this.LJIIJJI;
            n.LIZIZ(qeg3, "");
            qeg3.setText(String.valueOf(floatValue));
            4ZZ r1 = this.LJIIL;
            r1.setIconRes(2131755648);
            r1.setTintColorRes(2130968583);
        }
        Qeg qeg4 = this.LJI;
        n.LIZIZ(qeg4, "");
        if (j == 0) {
            i = 8;
        } else {
            i = 0;
        }
        qeg4.setVisibility(i);
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        IPdpStarter.PdpEnterParam pdpEnterParam = LJIILIIL().LIZ;
        if (!(pdpEnterParam == null || (trackParams2 = pdpEnterParam.getTrackParams()) == null)) {
            linkedHashMap.putAll(trackParams2);
        }
        linkedHashMap.remove("page_name");
        linkedHashMap.put("previous_page", "product_detail");
        IPdpStarter.PdpEnterParam pdpEnterParam2 = LJIILIIL().LIZ;
        if (pdpEnterParam2 == null || (trackParams = pdpEnterParam2.getTrackParams()) == null || (obj2 = trackParams.get("source_page_type")) == null) {
            obj2 = "unknown";
        }
        n.LIZIZ(obj2, "");
        linkedHashMap.put("show_window_source", obj2);
        View view4 = this.itemView;
        n.LIZIZ(view4, "");
        3SB.LIZ(view4, (0CH) null, 0, new C4913BrB(this, brA, str, linkedHashMap, (4r1) null), 3);
        BJ3 bj3 = BTH.LIZLLL;
        View view5 = this.itemView;
        n.LIZIZ(view5, "");
        bj3.LIZ(view5, false);
        MethodCollector.o(52);
    }
}
