package com.ss.android.ugc.aweme.ecommerce.mall.tools.cell;

import X.0CH;
import X.0HH;
import X.2Pr;
import X.4Ev;
import X.4HR;
import X.4hP;
import X.A9N;
import X.A9O;
import X.A9P;
import X.A9Q;
import X.A9R;
import X.A9S;
import X.A9T;
import X.A9U;
import X.A9V;
import X.A9W;
import X.A9X;
import X.A9Y;
import X.A9Z;
import X.ARD;
import X.ARE;
import X.AX4;
import X.AX5;
import X.AX6;
import X.AXA;
import X.AXB;
import X.AXC;
import X.AXF;
import X.AXG;
import X.AXL;
import X.AXM;
import X.AXN;
import X.AXO;
import X.B3G;
import X.C0598A9a;
import X.C0599A9b;
import X.C0600A9c;
import X.C2311AqJ;
import X.C4024Bcq;
import X.C4350Bi6;
import X.C4373BiT;
import X.C4374BiU;
import X.C6673CeT;
import X.Csa;
import X.Csw;
import X.Csy;
import X.Ct1;
import X.Cuh;
import X.Cus;
import X.Cv8;
import X.Cvh;
import X.CwK;
import X.CwU;
import X.CwZ;
import X.Cwc;
import X.Cwf;
import X.Cwu;
import X.D1G;
import X.DaP;
import X.KEM;
import X.LWw;
import X.LsC;
import X.LsD;
import X.LsE;
import X.LsF;
import X.Lsh;
import X.M12;
import X.MEH;
import X.P4n;
import X.P50;
import X.PHD;
import X.QHW;
import X.QJt;
import X.Qeg;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.bytedance.assem.arch.viewModel.AssemViewModel;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.powerlist.PowerCell;
import com.ss.android.ugc.aweme.ecommerce.mall.vm.MallMainViewModel;
import com.ss.android.ugc.aweme.ecommerce.mall.vm.ShopMainViewModel;
import java.util.Map;
import kotlin.h.b.n;
import kotlin.o.y;

public final class ToolEntryCellNew extends PowerCell<C2311AqJ> implements ARE {
    public final Csa LIZ;
    public final Csa LIZIZ;

    static {
        Covode.recordClassIndex(70496);
    }

    public final 0CH getActualLifecycleOwner() {
        ARD.LIZIZ(this);
        return this;
    }

    public final Cv8 getActualLifecycleOwnerHolder() {
        ARD.LIZ(this);
        return this;
    }

    public final 4hP getActualReceiver() {
        ARD.LIZLLL(this);
        return this;
    }

    public final Cuh<4hP> getActualReceiverHolder() {
        ARD.LIZJ(this);
        return this;
    }

    public final 0CH getHostLifecycleOwner() {
        M12.LIZ(this);
        return null;
    }

    public final 0CH getOwnLifecycleOwner() {
        ARD.LJ(this);
        return this;
    }

    public final 4hP getReceiverForHostVM() {
        M12.LIZ(this);
        return null;
    }

    public final boolean getUniqueOnlyDefault() {
        return ARD.LJFF(this);
    }

    public final void bD_() {
        ToolEntryCellNew.super.bD_();
        if (MEH.LIZ.LIZ()) {
            Cus.LIZ(this, (ShopMainViewModel) this.LIZIZ.getValue(), P4n.LIZ, (Cvh) null, new C4373BiT(this), 6);
            return;
        }
        Cus.LIZ(this, (MallMainViewModel) this.LIZ.getValue(), P50.LIZ, (Cvh) null, new C4374BiU(this), 6);
    }

    public ToolEntryCellNew() {
        Csa csa;
        Csa csa2;
        Csy csy = Csy.LIZ;
        D1G LIZ2 = KEM.LIZ.LIZ(MallMainViewModel.class);
        C0599A9b a9b = new C0599A9b(LIZ2);
        AXG axg = AXG.INSTANCE;
        if (n.LIZ(csy, Csw.LIZ)) {
            csa = new Csa(LIZ2, a9b, AX5.INSTANCE, new A9Q(this), new A9O(this), AXO.INSTANCE, axg);
        } else if (n.LIZ(csy, Csy.LIZ)) {
            csa = new Csa(LIZ2, a9b, AX6.INSTANCE, new A9T(this), new A9R(this), AXL.INSTANCE, axg);
        } else if (csy != null && !n.LIZ(csy, Ct1.LIZ)) {
            throw new IllegalArgumentException("Don't support this VMScope: " + csy + " there");
        } else {
            csa = new Csa(LIZ2, a9b, AX4.INSTANCE, new A9Z(this), new A9V(this), new A9W(this), axg);
        }
        this.LIZ = csa;
        Csy csy2 = Csy.LIZ;
        D1G LIZ3 = KEM.LIZ.LIZ(ShopMainViewModel.class);
        C0600A9c a9c = new C0600A9c(LIZ3);
        AXF axf = AXF.INSTANCE;
        if (n.LIZ(csy2, Csw.LIZ)) {
            csa2 = new Csa(LIZ3, a9c, AXA.INSTANCE, new A9P(this), new A9N(this), AXM.INSTANCE, axf);
        } else if (n.LIZ(csy2, Csy.LIZ)) {
            csa2 = new Csa(LIZ3, a9c, AXB.INSTANCE, new A9U(this), new A9S(this), AXN.INSTANCE, axf);
        } else if (csy2 != null && !n.LIZ(csy2, Ct1.LIZ)) {
            throw new IllegalArgumentException("Don't support this VMScope: " + csy2 + " there");
        } else {
            csa2 = new Csa(LIZ3, a9c, AXC.INSTANCE, new C0598A9a(this), new A9X(this), new A9Y(this), axf);
        }
        this.LIZIZ = csa2;
    }

    public final View LIZ(ViewGroup viewGroup) {
        M12.LIZ(viewGroup);
        Context context = viewGroup.getContext();
        n.LIZIZ(context, "");
        int LIZ2 = (int) (((double) 4Ev.LIZ(context)) / 4.5d);
        View LIZ3 = 0HH.LIZ(LayoutInflater.from(viewGroup.getContext()), 2131559216, viewGroup, false);
        n.LIZIZ(LIZ3, "");
        ConstraintLayout findViewById = LIZ3.findViewById(2131371320);
        n.LIZIZ(findViewById, "");
        ViewGroup.LayoutParams layoutParams = findViewById.getLayoutParams();
        layoutParams.width = LIZ2;
        ConstraintLayout findViewById2 = LIZ3.findViewById(2131371320);
        n.LIZIZ(findViewById2, "");
        findViewById2.setLayoutParams(layoutParams);
        return LIZ3;
    }

    /* JADX WARNING: type inference failed for: r0v27, types: [X.Bcq, android.view.View$OnClickListener] */
    public final /* synthetic */ void LIZ(DaP daP) {
        C2311AqJ aqJ = (C2311AqJ) daP;
        M12.LIZ(aqJ);
        Map LIZIZ2 = LWw.LIZIZ(new Cwu[]{CwZ.LIZ("button_name", aqJ.LIZ.getButtonName()), CwZ.LIZ("actionsheet_name", "mall_tools"), CwZ.LIZ("page_struc_type", "tools_in")});
        View view = this.itemView;
        n.LIZIZ(view, "");
        if (view.findViewById(2131371321).LIZIZ) {
            LIZIZ2.put("notice_number", "");
            LIZIZ2.put("notice_type", "red_dot");
        }
        C6673CeT.LIZIZ.LIZJ((Map<String, String>) LIZIZ2);
        if (aqJ.LIZ.getNotify()) {
            View view2 = this.itemView;
            n.LIZIZ(view2, "");
            view2.findViewById(2131371321).LIZ();
        } else {
            View view3 = this.itemView;
            n.LIZIZ(view3, "");
            view3.findViewById(2131371321).LIZIZ();
        }
        View view4 = this.itemView;
        n.LIZIZ(view4, "");
        Qeg findViewById = view4.findViewById(2131372434);
        n.LIZIZ(findViewById, "");
        findViewById.setText(aqJ.LIZ.getTitle());
        B3G imageUrls = aqJ.LIZ.getImageUrls();
        if (imageUrls != null) {
            QJt LIZ2 = QHW.LIZ(imageUrls);
            View view5 = this.itemView;
            n.LIZIZ(view5, "");
            LIZ2.LJJIIZ = view5.findViewById(2131366678);
            LIZ2.LIZ(new C4350Bi6(this, aqJ));
        }
        String link = aqJ.LIZ.getLink();
        if (link != null && !y.LIZ(link)) {
            View view6 = this.itemView;
            n.LIZIZ(view6, "");
            ConstraintLayout findViewById2 = view6.findViewById(2131371320);
            n.LIZIZ(findViewById2, "");
            findViewById2.setOnClickListener(new C4024Bcq(this, aqJ));
        }
    }

    public final <S extends 4HR> void subscribe(AssemViewModel<S> assemViewModel, Cvh<S> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super S, 2Pr> lsD) {
        M12.LIZ(assemViewModel, cvh, lsD);
        ARD.LIZ(this, assemViewModel, cvh, lsC, lsD);
    }

    public final <S extends 4HR, A> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, Cvh<CwK<A>> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super A, 2Pr> lsD) {
        M12.LIZ(assemViewModel, phd, cvh, lsD);
        ARD.LIZ(this, assemViewModel, phd, cvh, lsC, lsD);
    }

    public final <S extends 4HR, A> void selectSubscribeOnAsync(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, Cvh<CwK<A>> cvh, LsC<? super Throwable, 2Pr> lsC, LsD<? super 4hP, ? super A, 2Pr> lsD) {
        M12.LIZ(assemViewModel, phd, cvh, lsD);
        ARD.LIZIZ(this, assemViewModel, phd, cvh, lsC, lsD);
    }

    public final <S extends 4HR, A, B> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, Cvh<CwU<A, B>> cvh, LsC<? super Throwable, 2Pr> lsC, LsE<? super 4hP, ? super A, ? super B, 2Pr> lsE) {
        M12.LIZ(assemViewModel, phd, phd2, cvh, lsE);
        ARD.LIZ(this, assemViewModel, phd, phd2, cvh, lsC, lsE);
    }

    public final <S extends 4HR, A, B, C> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, PHD<S, ? extends C> phd3, Cvh<Cwc<A, B, C>> cvh, LsC<? super Throwable, 2Pr> lsC, LsF<? super 4hP, ? super A, ? super B, ? super C, 2Pr> lsF) {
        LsF<? super 4hP, ? super A, ? super B, ? super C, 2Pr> lsF2 = lsF;
        AssemViewModel<S> assemViewModel2 = assemViewModel;
        PHD<S, ? extends A> phd4 = phd;
        PHD<S, ? extends B> phd5 = phd2;
        PHD<S, ? extends C> phd6 = phd3;
        Cvh<Cwc<A, B, C>> cvh2 = cvh;
        M12.LIZ(assemViewModel2, phd4, phd5, phd6, cvh2, lsF2);
        ARD.LIZ(this, assemViewModel2, phd4, phd5, phd6, cvh2, lsC, lsF2);
    }

    public final <S extends 4HR, A, B, C, D> void selectSubscribe(AssemViewModel<S> assemViewModel, PHD<S, ? extends A> phd, PHD<S, ? extends B> phd2, PHD<S, ? extends C> phd3, PHD<S, ? extends D> phd4, Cvh<Cwf<A, B, C, D>> cvh, LsC<? super Throwable, 2Pr> lsC, Lsh<? super 4hP, ? super A, ? super B, ? super C, ? super D, 2Pr> lsh) {
        Lsh<? super 4hP, ? super A, ? super B, ? super C, ? super D, 2Pr> lsh2 = lsh;
        AssemViewModel<S> assemViewModel2 = assemViewModel;
        PHD<S, ? extends A> phd5 = phd;
        PHD<S, ? extends B> phd6 = phd2;
        PHD<S, ? extends C> phd7 = phd3;
        PHD<S, ? extends D> phd8 = phd4;
        Cvh<Cwf<A, B, C, D>> cvh2 = cvh;
        M12.LIZ(assemViewModel2, phd5, phd6, phd7, phd8, cvh2, lsh2);
        ARD.LIZ(this, assemViewModel2, phd5, phd6, phd7, phd8, cvh2, lsC, lsh2);
    }
}
