package com.ss.android.ugc.aweme.relation.fp;

import X.1hK;
import X.2uR;
import X.3c7;
import X.3cA;
import X.3cC;
import X.3cI;
import X.4pG;
import X.A7H;
import X.AkS;
import X.Al1;
import X.AoK;
import X.C0314Csc;
import X.C0330Css;
import X.C1580Dc0;
import X.C3059Dzr;
import X.C3982EZe;
import X.C4003EZz;
import X.C5566EzC;
import X.C5671F2d;
import X.C5672F2e;
import X.C5675F2h;
import X.C5678F2k;
import X.C5679F2l;
import X.C5681F2n;
import X.C5683F2p;
import X.CZv;
import X.EZL;
import X.J7F;
import X.KEM;
import X.Ls2;
import X.M12;
import android.content.Context;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.ss.android.ugc.aweme.relation.ffp.vm.FindFriendsPageVM;
import com.ss.android.ugc.aweme.relation.share.InviteFriendsPageSharePackage;
import kotlin.h.b.n;

@CZv
public final class InviteFriendsPage extends BaseFriendsPage {
    public EZL LJ;
    public InviteFriendsPageSharePackage LJFF;
    public final C0314Csc LJI;
    public 4pG LJII;
    public final int LJIIIIZZ = 2131559770;
    public SparseArray LJIIIZ;

    static {
        Covode.recordClassIndex(103151);
    }

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

    public final FindFriendsPageVM LIZJ() {
        return (FindFriendsPageVM) this.LJI.getValue();
    }

    public final void LJI() {
        SparseArray sparseArray = this.LJIIIZ;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    public final int LIZ() {
        return this.LJIIIIZZ;
    }

    /* JADX WARNING: type inference failed for: r0v0, types: [X.Cue] */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void LIZIZ() {
        /*
            r6 = this;
            com.ss.android.ugc.aweme.relation.ffp.vm.FindFriendsPageVM r1 = r6.LIZJ()
            X.PHD r2 = X.Akx.LIZ
            X.F2g r4 = new X.F2g
            r4.<init>(r6)
            r3 = 0
            r5 = 6
            r0 = r6
            X.C0382Cus.LIZ((X.C0368Cue) r0, (com.bytedance.assem.arch.viewModel.AssemViewModel) r1, (X.PHD) r2, (X.C0397Cvh) r3, (X.LsD) r4, (int) r5)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.relation.fp.InviteFriendsPage.LIZIZ():void");
    }

    public final void onDestroyView() {
        InviteFriendsPage.super.onDestroyView();
        if (this.LJFF != null) {
            InviteFriendsPageSharePackage inviteFriendsPageSharePackage = this.LJFF;
            if (inviteFriendsPageSharePackage == null) {
                n.LIZ("");
            }
            inviteFriendsPageSharePackage.LIZIZ.LIZ();
        }
        LJI();
    }

    public InviteFriendsPage() {
        C5683F2p f2p = C5683F2p.LIZ;
        this.LJI = new C0314Csc(KEM.LIZ.LIZ(FindFriendsPageVM.class), f2p, C0330Css.LIZ, AoK.LIZ(this, false), A7H.LIZ, C5681F2n.INSTANCE, AoK.LIZ(this, true), AoK.LIZIZ(this, true));
    }

    public final void LIZLLL() {
        MethodCollector.i(7532);
        View inflate = View.inflate(getContext(), 2131559775, (ViewGroup) null);
        4pG findViewById = inflate.findViewById(2131367356);
        n.LIZIZ(findViewById, "");
        this.LJII = findViewById;
        EZL LIZ = C4003EZz.LIZ.LIZ();
        1hK requireActivity = requireActivity();
        n.LIZIZ(requireActivity, "");
        C3982EZe eZe = r8;
        C3982EZe eZe2 = new C3982EZe(requireActivity, C5566EzC.FIND_FRIENDS, new C3059Dzr("invite_friends", (String) null, (String) null, (String) null, 14), false, false, false, false, false, false, false, (Integer) null, (Integer) null, false, (String) null, (String) null, 123504);
        LIZ.LIZ(eZe);
        LIZ.LIZ((Ls2<Boolean>) new C5678F2k(this, inflate));
        View view = getView();
        if (!(view instanceof ViewGroup)) {
            view = null;
        }
        ViewGroup viewGroup = (ViewGroup) view;
        if (viewGroup != null) {
            viewGroup.addView(LIZ.LIZIZ(), -1, -1);
        }
        LIZ.LIZJ().LIZ(0, inflate);
        this.LJ = LIZ;
        4pG r1 = this.LJII;
        if (r1 == null) {
            n.LIZ("");
        }
        LIZ(r1);
        LIZ(LIZJ(), new C5675F2h(this));
        MethodCollector.o(7532);
    }

    public static final /* synthetic */ InviteFriendsPageSharePackage LIZ(InviteFriendsPage inviteFriendsPage) {
        InviteFriendsPageSharePackage inviteFriendsPageSharePackage = inviteFriendsPage.LJFF;
        if (inviteFriendsPageSharePackage == null) {
            n.LIZ("");
        }
        return inviteFriendsPageSharePackage;
    }

    private final void LIZ(4pG r6) {
        Context context = r6.getContext();
        J7F j7f = new J7F();
        j7f.LIZ("text");
        InviteFriendsPageSharePackage inviteFriendsPageSharePackage = new InviteFriendsPageSharePackage("invitevia", "invite_friends", j7f);
        this.LJFF = inviteFriendsPageSharePackage;
        inviteFriendsPageSharePackage.LIZ();
        InviteFriendsPageSharePackage inviteFriendsPageSharePackage2 = this.LJFF;
        if (inviteFriendsPageSharePackage2 == null) {
            n.LIZ("");
        }
        1hK requireActivity = requireActivity();
        n.LIZIZ(requireActivity, "");
        r6.LIZ(inviteFriendsPageSharePackage2.LIZ(requireActivity));
        r6.LIZ(new C5672F2e(this, context));
    }

    public final void LIZ(View view) {
        M12.LIZ(view);
        3c7 findViewById = view.findViewById(2131367895);
        2uR r4 = new 2uR();
        3cA r1 = new 3cA();
        r1.LIZ(2131755170);
        r1.LIZIZ = true;
        r1.LIZ(new C5679F2l(this));
        r4.LIZ(new 3cI[]{r1});
        3cC r2 = new 3cC();
        CharSequence text = getText(2131826293);
        n.LIZIZ(text, "");
        r2.LIZ(text);
        r4.LIZ(r2);
        findViewById.setNavActions(r4);
        findViewById.LIZ(true);
        if (!C1580Dc0.CONTACT.isGrant()) {
            C1580Dc0 dc0 = C1580Dc0.CONTACT;
            Context requireContext = requireContext();
            n.LIZIZ(requireContext, "");
            Al1.LIZ(dc0, requireContext, new AkS(LIZJ().getState().LIZLLL.LIZ, "auto", (String) null, 4), new C5671F2d(this));
            return;
        }
        LIZLLL();
    }
}
