package com.ss.android.ugc.aweme.account.changemail;

import X.070;
import X.2nK;
import X.7he;
import X.C1633RlF;
import X.C1741Rmz;
import X.C2133RtJ;
import X.C2162Rtm;
import X.C2180Ru4;
import X.C2202RuQ;
import X.C2222Ruk;
import X.C2247Rv9;
import X.C2255RvH;
import X.C2262RvO;
import X.C2265RvR;
import X.C2438RyE;
import X.C2580S1g;
import X.Crj;
import X.JtF;
import X.LsE;
import X.M12;
import X.PgW;
import X.Qeg;
import android.os.Bundle;
import android.view.View;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.account.login.v2.base.BaseAccountFlowFragment;
import com.ss.android.ugc.aweme.account.login.v2.timer.TimerHolder;
import com.ss.android.ugc.aweme.account.login.v2.ui.fragments.CommonInputEmailFragment;
import java.util.HashMap;
import kotlin.h.b.n;

public final class ChangeEmailFragment extends CommonInputEmailFragment {
    public static final int LIZ = 7;
    public static final LsE<BaseAccountFlowFragment, String, String, PgW<C1633RlF<C1741Rmz>>> LIZIZ = C2222Ruk.LIZ;
    public static final C2265RvR LIZJ = new C2265RvR((byte) 0);
    public final Crj LIZLLL = 7he.LIZ(new C2255RvH(this));
    public HashMap LJIILIIL;

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

    public final boolean LJII() {
        return ((Boolean) this.LIZLLL.getValue()).booleanValue();
    }

    public final void LJIIJ() {
        HashMap hashMap = this.LJIILIIL;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    public final /* synthetic */ void onDestroyView() {
        super.onDestroyView();
        LJIIJ();
    }

    static {
        Covode.recordClassIndex(50678);
    }

    public final void LJIIIIZZ() {
        if (LJII()) {
            JtF jtF = new JtF();
            jtF.LIZ("page", "Input Email Captcha");
            jtF.LIZ("error_code", "1");
            2nK.LIZ("input_wrong_email", jtF.LIZ);
        }
    }

    public final C2202RuQ LIZLLL() {
        int i;
        int i2;
        C2202RuQ ruQ = new C2202RuQ((String) null, (String) null, false, (String) null, (String) null, false, (String) null, false, false, 2047);
        if (LJII()) {
            i = 2131832246;
        } else {
            i = 2131832211;
        }
        ruQ.LJ = getString(i);
        if (LJII()) {
            i2 = 2131832245;
        } else {
            i2 = 2131832209;
        }
        ruQ.LJFF = getString(i2);
        ruQ.LIZ = " ";
        ruQ.LJIIIZ = false;
        ruQ.LJII = true;
        return ruQ;
    }

    public final void LIZ(String str) {
        C2180Ru4 ru4;
        M12.LIZ(str);
        C2133RtJ.LIZ.LIZ((Fragment) this, str);
        C2247Rv9 LIZ2 = TimerHolder.LIZIZ.LIZ(getActivity(), str, LJJI());
        if (LIZ2 == null || (ru4 = LIZ2.LIZ) == null || !ru4.LIZLLL()) {
            ((PgW) LIZIZ.invoke(this, str, "user_click")).LIZLLL(new C2262RvO(this)).LIZLLL();
        } else {
            LIZ(false);
        }
    }

    public final void LIZ(boolean z) {
        C2133RtJ.LIZ.LIZ((Fragment) this, z);
        Bundle arguments = getArguments();
        if (arguments == null) {
            n.LIZIZ();
        }
        arguments.putInt("next_page", C2162Rtm.EMAIL_SMS_CHANGE.getValue());
        n.LIZIZ(arguments, "");
        LIZ(arguments);
    }

    public final void onViewCreated(View view, Bundle bundle) {
        M12.LIZ(view);
        super.onViewCreated(view, bundle);
        Bundle arguments = getArguments();
        if (arguments == null) {
            n.LIZIZ();
        }
        if (arguments.getBoolean("use_phone") || LJII()) {
            Qeg LIZ2 = LIZ(2131363236);
            n.LIZIZ(LIZ2, "");
            LIZ2.setVisibility(0);
            Qeg LIZ3 = LIZ(2131363236);
            n.LIZIZ(LIZ3, "");
            LIZ(2131363236).setTextColor(070.LIZJ(LIZ3.getContext(), 2131099750));
            Qeg LIZ4 = LIZ(2131363236);
            n.LIZIZ(LIZ4, "");
            C2580S1g.LIZ.LIZ(LIZ4, new C2438RyE(this), 2131832212, 2131832213);
        }
    }
}
