package com.ss.android.ugc.aweme.feed.adapter;

import X.0Gf;
import X.0Gp;
import X.2GO;
import X.2oQ;
import X.46i;
import X.4aP;
import X.7SJ;
import X.7Tv;
import X.7Za;
import X.878;
import X.8Fb;
import X.BPA;
import X.C4580EjI;
import X.Cn7;
import X.Cn8;
import android.text.TextUtils;
import android.view.View;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.main.MainPageExperimentServiceImpl;
import com.ss.android.ugc.aweme.out.AVExternalServiceImpl;
import com.ss.android.ugc.aweme.services.specialplus.ISpecialPlusService;
import com.ss.android.ugc.aweme.services.superentrance.ISuperEntranceService;
import com.ss.android.ugc.aweme.services.superentrance.SuperEntranceEvent;
import java.util.List;

public class FullFeedVideoViewHolder extends VideoViewCell implements 2GO {
    public long LIZLLL;

    static {
        Covode.recordClassIndex(76446);
    }

    public int LJIIJJI() {
        return 2;
    }

    private boolean LJJIIZI() {
        return TextUtils.equals(LJLIIIL(), "homepage_hot");
    }

    public final 7Tv LJIIL() {
        return new 7Tv(true, 7Za.LIZIZ.LIZ().LIZ);
    }

    public FullFeedVideoViewHolder(4aP r1) {
        super(r1);
    }

    public final void LIZ(long j) {
        super.LIZ(j);
    }

    public void LIZLLL(boolean z) {
        super.LIZLLL(z);
        if (LJJIIZI()) {
            C4580EjI.LIZ().maybeMonitorTimeSpend(this.LJIIL, Long.valueOf(this.LIZLLL));
        }
    }

    public void onRenderFirstFrame(8Fb r7) {
        int i;
        super.onRenderFirstFrame(r7);
        if (LJJIIZI()) {
            this.LIZLLL = System.currentTimeMillis();
        }
        Aweme aweme = this.LJIIL;
        if (this.LJIILIIL == 0) {
            i = 2000;
        } else {
            i = 0;
        }
        0Gp.LIZ((long) i).LIZ(new Cn7(this, AVExternalServiceImpl.LIZ().specialPlusService(), aweme), 0Gp.LIZ, (0Gf) null).LIZIZ(Cn8.LIZ, 0Gp.LIZIZ);
    }

    public static final /* synthetic */ 0Gp LIZ(0Gp r4) {
        try {
            if (TextUtils.equals((CharSequence) r4.LIZLLL(), "hide")) {
                new SuperEntranceEvent(3, false).post();
                return null;
            } else if (TextUtils.equals((CharSequence) r4.LIZLLL(), "show")) {
                new SuperEntranceEvent(3, true).post();
                return null;
            } else if (!TextUtils.equals((CharSequence) r4.LIZLLL(), "normal")) {
                return null;
            } else {
                new SuperEntranceEvent(0, false).post();
                return null;
            }
        } catch (Throwable unused) {
            return null;
        }
    }

    public final void LIZIZ(boolean z) {
        if (TextUtils.equals(LJLIIIL(), "homepage_follow")) {
            MainPageExperimentServiceImpl.LIZIZ();
        }
        if (TextUtils.equals(LJLIIIL(), "homepage_friends") && 2oQ.LIZ().LIZJ) {
            z = 2oQ.LIZ().LIZJ;
        }
        if (TextUtils.equals(LJLIIIL(), "homepage_popular") && 2oQ.LIZ().LIZLLL) {
            z = 2oQ.LIZ().LIZLLL;
        }
        if (TextUtils.equals(LJLIIIL(), "homepage_nearby") && 2oQ.LIZ().LJ) {
            z = 2oQ.LIZ().LJ;
        }
        super.LIZIZ(z);
    }

    public final void LJFF(Aweme aweme) {
        ISuperEntranceService superEntranceService;
        if (!7SJ.LIZ && this.LJIILIIL != 0 && 46i.LJFF() != null) {
            if ((!46i.LJFF().isLogin() || !TextUtils.equals(this.LJIIL.getAuthorUid(), 46i.LJFF().getCurUserId())) && (superEntranceService = AVExternalServiceImpl.LIZ().superEntranceService()) != null && superEntranceService.shouldShowSuperEntranceRecord(LJL())) {
                List<String> superEntranceEffectList = superEntranceService.getSuperEntranceEffectList();
                BPA stickerEntranceInfo = aweme.getStickerEntranceInfo();
                if (stickerEntranceInfo != null && !878.LIZ(superEntranceEffectList) && superEntranceEffectList.contains(stickerEntranceInfo.id)) {
                    new SuperEntranceEvent(1, true).post();
                    superEntranceService.setShowedSuperEntranceTab();
                }
            }
        }
    }

    public final /* synthetic */ String LIZ(ISpecialPlusService iSpecialPlusService, Aweme aweme) {
        try {
            if (!iSpecialPlusService.shouldShowSpecialPlus()) {
                return "hide";
            }
            if (iSpecialPlusService.isQuickPromoPlusEnabled()) {
                if (46i.LJFF() == null || !46i.LJFF().isLogin() || 46i.LJFF().isChildrenMode() || (System.currentTimeMillis() / 1000) - 46i.LJFF().getCurUser().getRegisterTime() < 604800) {
                    return "normal";
                }
                return "show";
            } else if (!LJJIIZI()) {
                return "normal";
            } else {
                if (46i.LJFF() == null || (46i.LJFF().isLogin() && TextUtils.equals(this.LJIIL.getAuthorUid(), 46i.LJFF().getCurUserId()))) {
                    return "normal";
                }
                List<String> specialPlusEffectList = iSpecialPlusService.getSpecialPlusEffectList();
                String stickerIDs = aweme.getStickerIDs();
                if (!878.LIZ(specialPlusEffectList) && !TextUtils.isEmpty(stickerIDs)) {
                    for (String contains : stickerIDs.split(",")) {
                        if (specialPlusEffectList.contains(contains)) {
                            return "show";
                        }
                    }
                }
                return "normal";
            }
        } catch (Throwable unused) {
        }
    }

    public final void LIZ(View view, boolean z) {
        if (TextUtils.equals(LJLIIIL(), "homepage_follow")) {
            MainPageExperimentServiceImpl.LIZIZ();
        }
        if (TextUtils.equals(LJLIIIL(), "homepage_friends") && 2oQ.LIZ().LIZJ) {
            z = 2oQ.LIZ().LIZJ;
        }
        if (TextUtils.equals(LJLIIIL(), "homepage_popular") && 2oQ.LIZ().LIZLLL) {
            z = 2oQ.LIZ().LIZLLL;
        }
        if (TextUtils.equals(LJLIIIL(), "homepage_nearby") && 2oQ.LIZ().LJ) {
            z = 2oQ.LIZ().LJ;
        }
        super.LIZ(view, z);
    }
}
