package com.bytedance.android.live.rank.impl.list.controller;

import X.6Is;
import X.7he;
import X.AnonymousClass0CB;
import X.AnonymousClass0CH;
import X.AnonymousClass0CN;
import X.AnonymousClass138;
import X.AnonymousClass13A;
import X.AnonymousClass13C;
import X.C09630aP;
import X.C11100cm;
import X.C529327n;
import X.Crj;
import X.Gg0;
import X.M12;
import androidx.fragment.app.Fragment;
import com.bytedance.android.live.liveinteract.api.IInteractService;
import com.bytedance.android.live.rank.impl.list.controller.base.BaseRankController;
import com.bytedance.android.live.rank.impl.list.vm.RankRootViewModel;
import com.bytedance.android.livesdk.event.UserProfileEvent;
import com.bytedance.android.livesdk.rank.list.model.RankListV2Response;
import com.bytedance.covode.number.Covode;
import java.util.LinkedHashMap;

public final class RankRootController extends BaseRankController implements 6Is {
    public static final AnonymousClass13C LIZIZ = new AnonymousClass13C((byte) 0);
    public AnonymousClass138 LIZ;
    public final Crj LIZLLL;

    static {
        Covode.recordClassIndex(10262);
    }

    public final RankRootViewModel LIZ() {
        return (RankRootViewModel) this.LIZLLL.getValue();
    }

    public final void onStateChanged(AnonymousClass0CH r2, AnonymousClass0CB r3) {
        super.onStateChanged(r2, r3);
        if (r3 == AnonymousClass0CB.ON_CREATE) {
            onCreate();
        } else if (r3 == AnonymousClass0CB.ON_DESTROY) {
            onDestroy();
        }
    }

    public final RankRootViewModel LIZIZ() {
        return LIZ();
    }

    @AnonymousClass0CN(LIZ = AnonymousClass0CB.ON_CREATE)
    public final void onCreate() {
        C09630aP.LIZ(3, "RankRootController", "onCreate");
    }

    @AnonymousClass0CN(LIZ = AnonymousClass0CB.ON_DESTROY)
    public final void onDestroy() {
        C09630aP.LIZ(3, "RankRootController", "onDestroy");
    }

    public RankRootController(Fragment fragment, AnonymousClass13A r3) {
        M12.LIZ(fragment, r3);
        this.LIZLLL = 7he.LIZ(new C529327n(fragment, r3));
    }

    public final void LIZ(RankListV2Response.RankView rankView, RankListV2Response.RankInfo rankInfo, boolean z, String str) {
        String str2;
        String str3;
        UserProfileEvent userProfileEvent = new UserProfileEvent(rankInfo.LIZ);
        userProfileEvent.mReportType = "report_anchor";
        userProfileEvent.roomId = rankInfo.LJFF;
        userProfileEvent.mSource = str;
        userProfileEvent.coHostEnable = z;
        userProfileEvent.currentHasMultiCoHostPermission = ((IInteractService) C11100cm.LIZ(IInteractService.class)).hasMultiCoHostPermission();
        userProfileEvent.linkInRoomEnable = false;
        LinkedHashMap linkedHashMap = new LinkedHashMap();
        linkedHashMap.put("click_user_position", str);
        linkedHashMap.put("click_anchor_rank", String.valueOf(rankInfo.LIZIZ));
        if (rankInfo.LJFF > 0) {
            str2 = "1";
        } else {
            str2 = "0";
        }
        linkedHashMap.put("is_live", str2);
        if (rankView.LJIIIZ == -1) {
            str3 = "last_week";
        } else {
            str3 = "this_week";
        }
        linkedHashMap.put("rank_period", str3);
        userProfileEvent.mRankInfo = linkedHashMap;
        userProfileEvent.setEnterFromRankList(true);
        Gg0.LIZ().LIZ(userProfileEvent);
    }
}
