package com.ss.android.ugc.aweme.notification.tutorial;

import X.0Bt;
import X.1Bn;
import X.2Pr;
import X.7he;
import X.9EH;
import X.C0295Crj;
import X.EG2;
import X.EG4;
import X.EG5;
import X.EG6;
import X.PgU;
import android.content.Context;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.notice.repo.TutorialVideoInfo;
import com.ss.android.ugc.aweme.notice.repo.TutorialVideoResp;
import java.lang.ref.WeakReference;
import kotlin.h.b.n;

public final class TutorialVideoViewModel extends 0Bt {
    public final 1Bn<TutorialVideoResp> LIZ = new 1Bn<>();
    public final C0295Crj LIZIZ = 7he.LIZ(EG5.LIZ);
    public WeakReference<Context> LIZJ;

    static {
        Covode.recordClassIndex(95745);
    }

    public final PgU<TutorialVideoResp> LIZ() {
        PgU<TutorialVideoResp> LIZ2 = PgU.LIZ(new EG2(this));
        n.LIZIZ(LIZ2, "");
        return LIZ2;
    }

    public final TutorialVideoResp LIZIZ() {
        String str;
        String str2;
        String str3;
        String str4;
        String str5;
        String str6;
        try {
            EG4 eg4 = (EG4) EG6.LIZ.LIZ(EG4.class);
            str6 = eg4.LIZ("");
            str5 = eg4.LIZJ("");
            str4 = eg4.LJ(LIZ(2131827492));
            if (TextUtils.isEmpty(str4)) {
                str4 = LIZ(2131827492);
            }
            str3 = eg4.LJI(LIZ(2131827493));
            if (TextUtils.isEmpty(str3)) {
                str3 = LIZ(2131827493);
            }
            str2 = eg4.LJIIIIZZ(LIZ(2131827494));
            if (TextUtils.isEmpty(str2)) {
                str2 = LIZ(2131827494);
            }
            str = eg4.LJIIJ("");
        } catch (Exception unused) {
            str4 = LIZ(2131827492);
            str3 = LIZ(2131827492);
            str2 = LIZ(2131827492);
            str6 = "";
            str5 = str6;
            str = str5;
        }
        if (TextUtils.isEmpty(str6) || TextUtils.isEmpty(str)) {
            return new TutorialVideoResp((TutorialVideoInfo) null);
        }
        return new TutorialVideoResp(new TutorialVideoInfo(str6, str5, str4, str3, str2, str));
    }

    public final 2Pr LIZ(Context context) {
        if (context == null) {
            return null;
        }
        this.LIZJ = new WeakReference<>(context);
        return 2Pr.LIZ;
    }

    private final String LIZ(int i) {
        Context context;
        WeakReference<Context> weakReference = this.LIZJ;
        if (weakReference == null || (context = (Context) weakReference.get()) == null) {
            context = 9EH.LJJIFFI.LIZ();
        }
        String string = context.getString(i);
        n.LIZIZ(string, "");
        return string;
    }
}
