package com.ss.android.ugc.aweme.comment.ui;

import X.0HH;
import X.1hK;
import X.2uR;
import X.3YD;
import X.3cA;
import X.3cI;
import X.4wW;
import X.7he;
import X.C01759st;
import X.C01779sv;
import X.C0897AKn;
import X.C0898AKo;
import X.C0899AKp;
import X.C0900AKq;
import X.C0906AKw;
import X.C6474CbG;
import X.Cl7;
import X.CqM;
import X.Crj;
import X.M12;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.awemeservice.AwemeService;
import com.ss.android.ugc.aweme.comment.viewmodel.VideoViewAuthorizationViewModel;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import java.util.Map;
import kotlin.h.b.n;

public final class VideoViewHistoryAuthorizationFragment extends Fragment implements 3YD {
    public static final C01759st LIZLLL = new C01759st((byte) 0);
    public String LIZ = "";
    public Boolean LIZIZ = false;
    public String LIZJ;
    public final Crj LJ = 7he.LIZ(new C0906AKw(this));
    public SparseArray LJFF;

    static {
        Covode.recordClassIndex(57387);
    }

    public final View LIZ(int i) {
        if (this.LJFF == null) {
            this.LJFF = new SparseArray();
        }
        View view = (View) this.LJFF.get(i);
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i);
        this.LJFF.put(i, findViewById);
        return findViewById;
    }

    public final VideoViewAuthorizationViewModel LIZ() {
        return (VideoViewAuthorizationViewModel) this.LJ.getValue();
    }

    private Aweme LIZLLL() {
        return AwemeService.LIZIZ().LIZIZ(this.LIZJ);
    }

    public final String LIZJ() {
        if (Cl7.LJ(LIZLLL())) {
            return "story";
        }
        return "post";
    }

    public final /* synthetic */ void onDestroyView() {
        VideoViewHistoryAuthorizationFragment.super.onDestroyView();
        SparseArray sparseArray = this.LJFF;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final 2uR ch_() {
        2uR r3 = new 2uR();
        3cA r1 = new 3cA();
        r1.LIZ(2131755740);
        r1.LIZ(new C0898AKo(this));
        r3.LIZIZ(new 3cI[]{r1});
        return r3;
    }

    public final void onCreate(Bundle bundle) {
        String str;
        Boolean bool;
        VideoViewHistoryAuthorizationFragment.super.onCreate(bundle);
        LIZ().LIZ.observe(this, new C0897AKn(this));
        Bundle arguments = getArguments();
        String str2 = null;
        if (arguments != null) {
            str = arguments.getString("page_type", "");
        } else {
            str = null;
        }
        this.LIZ = str;
        Bundle arguments2 = getArguments();
        if (arguments2 != null) {
            bool = Boolean.valueOf(arguments2.getBoolean("is_auto_pop", false));
        } else {
            bool = null;
        }
        this.LIZIZ = bool;
        Bundle arguments3 = getArguments();
        if (arguments3 != null) {
            str2 = arguments3.getString("aid", "");
        }
        this.LIZJ = str2;
    }

    public final void onViewCreated(View view, Bundle bundle) {
        String str;
        int i;
        M12.LIZ(view);
        VideoViewHistoryAuthorizationFragment.super.onViewCreated(view, bundle);
        String str2 = this.LIZ;
        if (n.LIZ(this.LIZIZ, true)) {
            str = "auto_scene";
        } else {
            str = "click_bar";
        }
        4wW.LIZ("video_views_pop_up_show", str2, str, (String) null, (String) null, LIZJ(), "two_button", (String) null, (Map) null, 408);
        if ((!n.LIZ(this.LIZ, "personal_homepage")) && n.LIZ(this.LIZIZ, true)) {
            LIZ(2131364021).setIconRes(2131755574);
            LIZ(2131364022).setIconRes(2131755391);
            LIZ(2131364011).setText(2131834766);
            LIZ(2131364012).setText(2131834767);
            LIZ(2131364013).setText(2131834768);
            LIZ(2131372426).setText(2131834770);
        }
        ((C6474CbG) LIZ(2131363014)).setOnClickListener(new C0899AKp(this));
        ((C6474CbG) LIZ(2131363055)).setOnClickListener(new C0900AKq(this));
        1hK activity = getActivity();
        if (activity != null) {
            i = activity.hashCode();
        } else {
            i = 0;
        }
        CqM.LIZ(new C01779sv(1, i));
    }

    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        M12.LIZ(layoutInflater);
        return 0HH.LIZ(layoutInflater, 2131558842, viewGroup, false);
    }
}
