package com.bytedance.android.live.liveinteract.multiguest.opt.widget;

import X.2Pr;
import X.2fU;
import X.6Is;
import X.7Vw;
import X.9qj;
import X.AnonymousClass0AA;
import X.AnonymousClass0CB;
import X.AnonymousClass0CH;
import X.AnonymousClass0HH;
import X.AnonymousClass0UO;
import X.AnonymousClass1JF;
import X.AnonymousClass1JN;
import X.AnonymousClass1UP;
import X.AnonymousClass1US;
import X.C07930Ul;
import X.C09630aP;
import X.C10000b0;
import X.C10180bI;
import X.C10620c0;
import X.C11100cm;
import X.C11170ct;
import X.C11180cu;
import X.C11190cv;
import X.C14600iQ;
import X.C14680iY;
import X.C14780ii;
import X.C19210pr;
import X.C19320q2;
import X.C19620qW;
import X.C19630qX;
import X.C19640qY;
import X.C19650qZ;
import X.C19660qa;
import X.C19670qb;
import X.C19680qc;
import X.C19690qd;
import X.C19840qs;
import X.C19950r3;
import X.C21140sy;
import X.C21320tG;
import X.C21810u3;
import X.C22120uY;
import X.C22310ur;
import X.C22780vc;
import X.C24150xp;
import X.C24190xt;
import X.C24230xx;
import X.C24290y3;
import X.C31161Lu;
import X.C31861Om;
import X.C33431Un;
import X.C33451Up;
import X.C33661Vk;
import X.C33691Vn;
import X.C33701Vo;
import X.C33711Vp;
import X.C33721Vq;
import X.C34131Xf;
import X.C34361Yc;
import X.C35641bG;
import X.C41491kh;
import X.C41721l4;
import X.C42511mL;
import X.C42531mN;
import X.C42651mZ;
import X.C43231nV;
import X.C50831zl;
import X.C50941zw;
import X.C53922Bi;
import X.Fv7;
import X.Fx3;
import X.Fz8;
import X.G0S;
import X.G2l;
import X.GNd;
import X.GQb;
import X.Gb7;
import X.Gc2;
import X.Gg2;
import X.Gg3;
import X.GiY;
import X.Gio;
import X.Glh;
import X.H7d;
import X.HG2;
import X.HK2;
import X.HK3;
import X.Ls0;
import X.LsC;
import X.M12;
import X.PMk;
import X.PMp;
import X.Po7;
import X.Ppr;
import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.os.Message;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.view.SurfaceView;
import android.widget.FrameLayout;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.Fragment;
import com.bytedance.android.live.base.model.user.FollowInfo;
import com.bytedance.android.live.base.model.user.User;
import com.bytedance.android.live.broadcast.api.IBroadcastService;
import com.bytedance.android.live.design.app.LiveDialog;
import com.bytedance.android.live.liveinteract.api.LinkMicGuestWidget;
import com.bytedance.android.live.liveinteract.multilive.guset.dialog.MultiLiveGuestUserInfoDialog;
import com.bytedance.android.live.liveinteract.multilive.guset.fragment.MultiGuestPreviewFragment;
import com.bytedance.android.live.liveinteract.multilive.guset.fragment.MultiGuestUserInfoFragment;
import com.bytedance.android.livesdk.LiveDialogFragment;
import com.bytedance.android.livesdk.chatroom.model.interact.LinkPlayerInfo;
import com.bytedance.android.livesdk.chatroom.model.multilive.MultiLiveLayoutInfo;
import com.bytedance.android.livesdk.livesetting.broadcast.LiveBroadcastAgeThresholdSetting;
import com.bytedance.android.livesdk.livesetting.linkmic.LiveAudienceLinkmicLowestAgeSetting;
import com.bytedance.android.livesdk.ui.BaseFragment;
import com.bytedance.android.livesdkapi.depend.model.live.Room;
import com.bytedance.bpea.basics.Cert;
import com.bytedance.bpea.basics.PrivacyCert;
import com.bytedance.bpea.store.policy.PrivacyPolicyStore;
import com.bytedance.common.utility.Logger;
import com.bytedance.common.utility.collection.WeakHandler;
import com.bytedance.covode.number.Covode;
import com.bytedance.ies.sdk.datachannel.DataChannel;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import kotlin.h.b.n;
import kotlin.o.y;

public final class MultiGuestAsGuestWidget extends LinkMicGuestWidget implements C42531mN, WeakHandler.IHandler, 6Is {
    public static final /* synthetic */ PMp[] LIZIZ = {new PMk(MultiGuestAsGuestWidget.class, "deepLinkEnterMultiLiveRoomHandler", "getDeepLinkEnterMultiLiveRoomHandler()Lcom/bytedance/android/live/liveinteract/multilive/guset/model/DeepLinkEnterMultiLiveRoomDataHandler;", 0)};
    public static final C19620qW LJIIIIZZ = new C19620qW((byte) 0);
    public WeakReference<C33661Vk> LIZJ;
    public C50831zl LIZLLL;
    public C19840qs LJ;
    public Runnable LJFF;
    public C19950r3 LJI = C19950r3.SEND_REQUEST;
    public C22120uY LJII;
    public WeakReference<MultiLiveGuestUserInfoDialog> LJIIIZ;
    public C42651mZ LJIIJ;
    public LiveDialog LJIIJJI;
    public WeakHandler LJIIL;
    public Room LJIILIIL;
    public final LsC<GQb, 2Pr> LJIILJJIL = new C50941zw(this);
    public final C19210pr LJIILL = new C33451Up();
    public final C14680iY LJIILLIIL = new C14680iY("DATA_MULTI_LIVE_DEEP_LINK_ENTER_ROOM");
    public boolean LJIIZILJ;
    public final FrameLayout LJIJ;

    public final void LIZ(Throwable th) {
        Gc2.LIZ(this, th);
    }

    public final void LJII() {
    }

    public final void LJIIJJI() {
    }

    public final int getLayoutId() {
        return 2131562101;
    }

    public final void onStateChanged(AnonymousClass0CH r1, AnonymousClass0CB r2) {
        super.onStateChanged(r1, r2);
    }

    public final C19950r3 LJIIIIZZ() {
        return this.LJI;
    }

    public final void LIZ(boolean z) {
        this.LJIIZILJ = z;
    }

    public final void LIZ(String str) {
        C19840qs r0 = this.LJ;
        if (r0 != null) {
            r0.LIZ(str);
        }
        GiY.LIZ().LJFF = str;
    }

    public final boolean LIZ(Runnable runnable, boolean z) {
        C31861Om LIZ = C31861Om.LIZ();
        n.LIZIZ(LIZ, "");
        Integer num = (Integer) LIZ.LJIILIIL;
        if (num == null || 2 != num.intValue()) {
            return false;
        }
        if (z) {
            HK2 hk2 = new HK2(getContext());
            hk2.LIZIZ(2131833955);
            hk2.LIZ(2131834141, new C19630qX(this, runnable), false);
            hk2.LIZIZ(2131833718, C19640qY.LIZ, false);
            LIZ(hk2.LIZ());
            return true;
        }
        this.LJFF = runnable;
        C50831zl r1 = this.LIZLLL;
        if (r1 != null) {
            r1.LIZJ("live_end", false);
        }
        C24150xp.LIZLLL.LIZIZ("live_over");
        C24150xp.LIZLLL.LIZ("live_over");
        return true;
    }

    public final void LIZ(List<? extends Po7> list, String str, Ppr ppr, int i) {
        LIZ(false, list, str);
    }

    /* JADX WARNING: type inference failed for: r1v6, types: [android.app.Dialog, X.1Vk] */
    public final void LIZ(List<LinkPlayerInfo> list) {
        DialogFragment dialogFragment;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog;
        C33431Un LIZJ2;
        ? r1;
        C33661Vk r12;
        C50831zl r13 = this.LIZLLL;
        if (r13 != null ? r13.LJIL() : false) {
            if (this.LJIIIZ == null) {
                C50831zl r0 = this.LIZLLL;
                Room room = r0 != null ? r0.LIZJ : null;
                C50831zl r02 = this.LIZLLL;
                C42511mL r3 = new C42511mL(room, false, (List<Po7>) null, "", (r02 == null || (LIZJ2 = r02.LIZJ()) == null) ? 0 : LIZJ2.LJI(), this.dataChannel);
                C22310ur r4 = MultiLiveGuestUserInfoDialog.LJIIIIZZ;
                DataChannel dataChannel = this.dataChannel;
                n.LIZIZ(dataChannel, "");
                this.LJIIIZ = new WeakReference<>(r4.LIZ(dataChannel, (AnonymousClass1US) r3, (WeakReference<C41721l4>) new WeakReference(this.LIZLLL), this.LJI, (C22120uY) null, "anchor_invite"));
            }
            AnonymousClass0AA LJIILJJIL2 = LJIILJJIL();
            if (LJIILJJIL2 != null) {
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference = this.LJIIIZ;
                if (!(weakReference == null || (multiLiveGuestUserInfoDialog = (MultiLiveGuestUserInfoDialog) weakReference.get()) == null)) {
                    multiLiveGuestUserInfoDialog.LIZ(this.LJI, this.LJII);
                }
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJIIIZ;
                if (weakReference2 != null && (dialogFragment = (DialogFragment) weakReference2.get()) != null) {
                    dialogFragment.show(LJIILJJIL2, "MultiLiveGuestUserInfoDialog");
                }
            }
        } else if (isViewValid() && this.LIZJ == null) {
            if (list == null) {
                list = new ArrayList<>();
            }
            C50831zl r42 = this.LIZLLL;
            if (r42 != null) {
                Context context = this.context;
                n.LIZIZ(context, "");
                this.LIZJ = new WeakReference<>(new C33661Vk(context, r42, list));
            }
            WeakReference<C33661Vk> weakReference3 = this.LIZJ;
            if (!(weakReference3 == null || (r12 = (C33661Vk) weakReference3.get()) == null)) {
                r12.setOnDismissListener(new C19690qd(this));
            }
            WeakReference<C33661Vk> weakReference4 = this.LIZJ;
            if (weakReference4 != null && (r1 = (C33661Vk) weakReference4.get()) != 0) {
                r1.show();
                2fU.LIZ.LIZ(r1);
            }
        }
    }

    public final void LIZ(String str, SurfaceView surfaceView) {
        C33661Vk r0;
        WeakReference<C33661Vk> weakReference;
        C33661Vk r02;
        LiveDialogFragment liveDialogFragment;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference2;
        DialogFragment dialogFragment;
        if (str == null || str.length() == 0 || surfaceView == null) {
            String str2 = "onStartInteract encounter an exception, linkMicId: " + str + ", surfaceView:" + surfaceView;
            C09630aP.LIZ(6, "LinkInRoomVideoGuestWid", str2);
            C10620c0.LIZ(new Throwable(), str2);
            return;
        }
        C50831zl r03 = this.LIZLLL;
        if (r03 == null || !r03.LJIL()) {
            WeakReference<C33661Vk> weakReference3 = this.LIZJ;
            if (!(weakReference3 == null || (r0 = (C33661Vk) weakReference3.get()) == null || !r0.isShowing() || (weakReference = this.LIZJ) == null || (r02 = (C33661Vk) weakReference.get()) == null)) {
                r02.dismiss();
            }
        } else {
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference4 = this.LJIIIZ;
            if (!(weakReference4 == null || (liveDialogFragment = (LiveDialogFragment) weakReference4.get()) == null || !liveDialogFragment.LJIIJ() || (weakReference2 = this.LJIIIZ) == null || (dialogFragment = (DialogFragment) weakReference2.get()) == null)) {
                dialogFragment.dismiss();
            }
        }
        C19840qs r04 = this.LJ;
        if (r04 != null) {
            r04.LIZJ(false);
        }
        StringBuilder sb = new StringBuilder("guest onStartInteract param's interactId = ");
        sb.append(str);
        sb.append(" interactId = ");
        GiY LIZ = GiY.LIZ();
        String str3 = "";
        n.LIZIZ(LIZ, str3);
        String LIZIZ2 = LIZ.LIZIZ();
        if (LIZIZ2 == null) {
            LIZIZ2 = str3;
        }
        sb.append(LIZIZ2);
        Logger.i("multi-live", sb.toString());
        C19840qs r1 = this.LJ;
        if (r1 != null) {
            GiY LIZ2 = GiY.LIZ();
            n.LIZIZ(LIZ2, str3);
            String LIZIZ3 = LIZ2.LIZIZ();
            if (LIZIZ3 != null) {
                str3 = LIZIZ3;
            }
            if (surfaceView == null) {
                n.LIZIZ();
            }
            r1.LIZ(str3, surfaceView);
        }
    }

    public final void LIZ(MultiLiveLayoutInfo multiLiveLayoutInfo) {
        M12.LIZ(multiLiveLayoutInfo);
        if (multiLiveLayoutInfo.LIZ) {
            C14600iQ LIZ = C21320tG.LIZ(multiLiveLayoutInfo.LIZIZ, multiLiveLayoutInfo.LIZJ);
            C19840qs r0 = this.LJ;
            if (r0 != null) {
                r0.LIZ(LIZ);
            }
        }
    }

    public final void LIZ(boolean z, boolean z2) {
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference;
        LiveDialogFragment liveDialogFragment;
        DialogFragment dialogFragment;
        if (!z && (weakReference = this.LJIIIZ) != null && (liveDialogFragment = (LiveDialogFragment) weakReference.get()) != null && liveDialogFragment.LJIIJ()) {
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJIIIZ;
            if (!(weakReference2 == null || (dialogFragment = (DialogFragment) weakReference2.get()) == null)) {
                dialogFragment.dismiss();
            }
            if (z2) {
                String LIZ = C10000b0.LIZ(2131830517);
                n.LIZIZ(LIZ, "");
                LIZJ(LIZ);
                return;
            }
            String LIZ2 = C10000b0.LIZ(2131828338);
            n.LIZIZ(LIZ2, "");
            LIZJ(LIZ2);
        }
    }

    private final AnonymousClass0AA LJIILJJIL() {
        return (AnonymousClass0AA) this.dataChannel.LIZIZ(HG2.class);
    }

    public final void LJ() {
        C19840qs r1 = this.LJ;
        if (r1 != null) {
            r1.LIZJ(false);
        }
    }

    public final String LJIIL() {
        return getClass().getName();
    }

    static {
        Covode.recordClassIndex(8097);
    }

    public final void LIZLLL() {
        C19840qs r1 = this.LJ;
        if (r1 != null) {
            r1.LIZJ(true);
        }
        Runnable runnable = this.LJFF;
        if (runnable != null) {
            runnable.run();
        }
        this.LJFF = null;
    }

    public final void onDetachWidget() {
        MultiGuestAsGuestWidget.super.onDetachWidget();
        C50831zl r1 = this.LIZLLL;
        if (r1 != null) {
            r1.LJIJJ();
            r1.LJJI.LIZIZ(r1);
            r1.LJJ.LIZ();
        }
    }

    private final void LJIILIIL() {
        String str;
        long j;
        User owner;
        FollowInfo followInfo;
        this.LJI = C19950r3.SEND_REQUEST;
        C50831zl r1 = this.LIZLLL;
        if (r1 != null) {
            r1.LIZ(0);
        }
        if (this.LJIIZILJ) {
            str = "interaction_entrance";
        } else {
            str = "connection_button";
        }
        Room room = this.LJIILIIL;
        if (room == null || (owner = room.getOwner()) == null || (followInfo = owner.getFollowInfo()) == null) {
            j = 0;
        } else {
            j = followInfo.getFollowStatus();
        }
        C24230xx.LIZ(str, j);
    }

    public final void LIZJ() {
        HK2 hk2 = new HK2(this.context);
        hk2.LIZIZ(2131833953);
        hk2.LIZ(2131834141, C19650qZ.LIZ, false);
        HK3 LIZ = hk2.LIZ();
        n.LIZIZ(LIZ, "");
        LIZ.show();
        2fU.LIZ.LIZ(LIZ);
        C50831zl r1 = this.LIZLLL;
        if (r1 != null) {
            r1.LIZJ("leave_with_money_not_enough", false);
        }
    }

    public final boolean LJFF() {
        boolean z;
        LiveDialogFragment liveDialogFragment;
        C50831zl r0 = this.LIZLLL;
        if (r0 != null) {
            z = r0.LJIL();
        } else {
            z = false;
        }
        if (z) {
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference = this.LJIIIZ;
            if (weakReference == null || (liveDialogFragment = (LiveDialogFragment) weakReference.get()) == null || !liveDialogFragment.LJIIJ()) {
                return false;
            }
            return true;
        }
        C42651mZ r02 = this.LJIIJ;
        if (r02 == null || !r02.isShowing()) {
            return false;
        }
        return true;
    }

    public final void LJI() {
        C42651mZ r0;
        LiveDialogFragment liveDialogFragment;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference;
        DialogFragment dialogFragment;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJIIIZ;
        if (!(weakReference2 == null || (liveDialogFragment = (LiveDialogFragment) weakReference2.get()) == null || !liveDialogFragment.LJIIJ() || (weakReference = this.LJIIIZ) == null || (dialogFragment = (DialogFragment) weakReference.get()) == null)) {
            dialogFragment.dismiss();
        }
        C42651mZ r02 = this.LJIIJ;
        if (r02 != null && r02.isShowing() && (r0 = this.LJIIJ) != null) {
            r0.dismiss();
        }
    }

    public final GNd LJIIIZ() {
        C42651mZ r2 = this.LJIIJ;
        if (r2 == null || r2.LIZIZ == null || !r2.LIZLLL || !r2.isShowing()) {
            return null;
        }
        r2.LIZIZ.setReleaseMode(false);
        GNd gNd = r2.LIZIZ;
        r2.LIZJ = true;
        return gNd;
    }

    public final void LJIIJ() {
        DialogFragment dialogFragment;
        if (LJFF() && this.LJI == C19950r3.GO_LIVE) {
            C50831zl r0 = this.LIZLLL;
            if (r0 == null || !r0.LJIL()) {
                C42651mZ r02 = this.LJIIJ;
                if (r02 != null) {
                    r02.dismiss();
                    return;
                }
                return;
            }
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference = this.LJIIIZ;
            if (weakReference != null && (dialogFragment = (DialogFragment) weakReference.get()) != null) {
                dialogFragment.dismiss();
            }
        }
    }

    public final void LIZ() {
        C50831zl r2 = this.LIZLLL;
        if (r2 != null) {
            r2.LIZJ("rtc_error", false);
        }
    }

    public final void LIZIZ() {
        Object obj;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference;
        DialogFragment dialogFragment;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog;
        LiveDialogFragment liveDialogFragment;
        DataChannel dataChannel = this.dataChannel;
        Fragment fragment = null;
        if (dataChannel != null) {
            obj = dataChannel.LIZIZ(Fx3.class);
        } else {
            obj = null;
        }
        if (!n.LIZ(obj, true)) {
            if (this.LJIIJJI == null) {
                C31161Lu r2 = new C31161Lu(this.context);
                r2.LIZJ(2131828992);
                r2.LIZ(2131830035, (C11170ct) C33711Vp.LIZ);
                this.LJIIJJI = r2.LIZIZ();
            }
            LiveDialog liveDialog = this.LJIIJJI;
            if (liveDialog != null) {
                LIZ(liveDialog);
            }
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJIIIZ;
            if (weakReference2 == null || (liveDialogFragment = (LiveDialogFragment) weakReference2.get()) == null || liveDialogFragment.LJIIJ()) {
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference3 = this.LJIIIZ;
                if (!(weakReference3 == null || (multiLiveGuestUserInfoDialog = (MultiLiveGuestUserInfoDialog) weakReference3.get()) == null)) {
                    fragment = multiLiveGuestUserInfoDialog.LJ;
                }
                if ((fragment instanceof MultiGuestPreviewFragment) && (weakReference = this.LJIIIZ) != null && (dialogFragment = (DialogFragment) weakReference.get()) != null) {
                    dialogFragment.dismiss();
                }
            }
        }
    }

    public final void onPause() {
        C35641bG LIZIZ2;
        WeakHandler weakHandler;
        C50831zl r0 = this.LIZLLL;
        if (r0 != null) {
            r0.LJIIZILJ();
        }
        C50831zl r02 = this.LIZLLL;
        if (!(r02 == null || (LIZIZ2 = r02.LIZIZ()) == null || !LIZIZ2.LJ || (weakHandler = this.LJIIL) == null)) {
            weakHandler.sendEmptyMessageDelayed(140000, 180000);
        }
        C42651mZ r03 = this.LJIIJ;
        if (r03 != null && r03.isShowing()) {
            C42651mZ r1 = this.LJIIJ;
            if ((r1 instanceof C42651mZ) && r1 != null) {
                r1.LIZIZ();
            }
        }
        AnonymousClass1JN r04 = (AnonymousClass1JN) C41491kh.LIZ.LIZIZ("MULTI_GUEST_REVIEW_MANAGER");
        if (r04 != null) {
            r04.LIZLLL();
        }
        super.onPause();
    }

    public final void onResume() {
        boolean z;
        super.onResume();
        WeakHandler weakHandler = this.LJIIL;
        if (weakHandler != null) {
            weakHandler.removeCallbacksAndMessages((Object) null);
        }
        C50831zl r0 = this.LIZLLL;
        if (r0 != null) {
            r0.LJIILLIIL();
        }
        C24150xp.LIZJ();
        C42651mZ r02 = this.LJIIJ;
        if (r02 != null && r02.isShowing()) {
            C42651mZ r5 = this.LJIIJ;
            if ((r5 instanceof C42651mZ) && r5 != null) {
                if (r5.LJIIJJI.LJJIJ == 2) {
                    z = false;
                } else {
                    z = true;
                }
                PrivacyCert.Builder with = PrivacyCert.Builder.with("bpea-463");
                with.usage("");
                with.tag("link mic camera active");
                with.policies(new 9qj[]{PrivacyPolicyStore.getVideoPrivacyPolicy(), PrivacyPolicyStore.getAudioPrivacyPolicy()});
                r5.LIZ(z, (Cert) with.build());
            }
        }
        AnonymousClass1JN r03 = (AnonymousClass1JN) C41491kh.LIZ.LIZIZ("MULTI_GUEST_REVIEW_MANAGER");
        if (r03 != null) {
            r03.LJ();
        }
    }

    public final void onDestroy() {
        C33661Vk r0;
        C42651mZ r02;
        LiveDialogFragment liveDialogFragment;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference;
        DialogFragment dialogFragment;
        C24190xt.LIZ("LinkIn_Guest_Widget_onDestroy");
        if (!C21140sy.LIZIZ(this.LJIILIIL)) {
            C24150xp.LIZ();
        }
        if (GiY.LIZ().LJJIFFI > 0) {
            C24150xp.LIZLLL((String) null);
        }
        GiY.LIZ().LIZ(false);
        C50831zl r03 = this.LIZLLL;
        if (r03 != null) {
            r03.f_();
        }
        C19840qs r04 = this.LJ;
        if (r04 != null) {
            r04.LIZ();
        }
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJIIIZ;
        if (!(weakReference2 == null || (liveDialogFragment = (LiveDialogFragment) weakReference2.get()) == null || !liveDialogFragment.LJIIJ() || (weakReference = this.LJIIIZ) == null || (dialogFragment = (DialogFragment) weakReference.get()) == null)) {
            dialogFragment.dismiss();
        }
        C42651mZ r05 = this.LJIIJ;
        if (!(r05 == null || !r05.isShowing() || (r02 = this.LJIIJ) == null)) {
            r02.dismiss();
        }
        this.dataChannel.LIZIZ(this);
        WeakReference<C33661Vk> weakReference3 = this.LIZJ;
        if (!(weakReference3 == null || (r0 = (C33661Vk) weakReference3.get()) == null)) {
            r0.dismiss();
        }
        LiveDialog liveDialog = this.LJIIJJI;
        if (liveDialog != null && liveDialog.isShowing()) {
            LiveDialog liveDialog2 = this.LJIIJJI;
            if (liveDialog2 != null) {
                liveDialog2.dismiss();
            }
            this.LJIIJJI = null;
        }
        MultiGuestAsGuestWidget.super.onDestroy();
    }

    /* JADX WARNING: type inference failed for: r4v0, types: [X.0CH] */
    /* JADX WARNING: Code restructure failed: missing block: B:14:0x007e, code lost:
        if (r6 == null) goto L_0x0080;
     */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void onCreate() {
        /*
            r14 = this;
            com.bytedance.android.live.liveinteract.multiguest.opt.widget.MultiGuestAsGuestWidget.super.onCreate()
            java.lang.String r0 = "LinkIn_Guest_Widget_onCreate"
            X.C24190xt.LIZ((java.lang.String) r0)
            com.bytedance.ies.sdk.datachannel.DataChannel r1 = r14.dataChannel
            java.lang.Class<X.Fv7> r0 = X.Fv7.class
            java.lang.Object r0 = r1.LIZIZ(r0)
            com.bytedance.android.livesdkapi.depend.model.live.Room r0 = (com.bytedance.android.livesdkapi.depend.model.live.Room) r0
            r14.LJIILIIL = r0
            com.bytedance.ies.sdk.datachannel.DataChannel r2 = r14.dataChannel
            java.lang.Class<X.2AX> r1 = X.AnonymousClass2AX.class
            X.LsC<X.GQb, X.2Pr> r0 = r14.LJIILJJIL
            r2.LIZ(r14, r1, r0)
            r4 = r14
            java.lang.Class<X.Fx2> r1 = X.Fx2.class
            X.1zx r0 = new X.1zx
            r0.<init>(r14)
            r2.LIZIZ(r4, r1, r0)
            java.lang.Class<X.2Be> r1 = X.C53882Be.class
            X.1zy r0 = new X.1zy
            r0.<init>(r14)
            r2.LIZ(r14, r1, r0)
            java.lang.Class<X.2BY> r1 = X.AnonymousClass2BY.class
            X.1zz r0 = new X.1zz
            r0.<init>(r14)
            r2.LIZ(r14, r1, r0)
            java.lang.Class<X.GwK> r1 = X.GwK.class
            X.200 r0 = new X.200
            r0.<init>(r14)
            r2.LIZIZ(r4, r1, r0)
            com.bytedance.android.livesdkapi.depend.model.live.Room r2 = r14.LJIILIIL
            java.lang.String r5 = ""
            if (r2 == 0) goto L_0x0058
            X.1zl r1 = new X.1zl
            com.bytedance.ies.sdk.datachannel.DataChannel r0 = r14.dataChannel
            kotlin.h.b.n.LIZIZ(r0, r5)
            r1.<init>(r2, r0)
            r14.LIZLLL = r1
        L_0x0058:
            X.1zl r1 = r14.LIZLLL
            if (r1 == 0) goto L_0x0060
            r0 = r14
            r1.LIZ((X.C42531mN) r0)
        L_0x0060:
            com.bytedance.common.utility.collection.WeakHandler r1 = new com.bytedance.common.utility.collection.WeakHandler
            r0 = r14
            r1.<init>(r0)
            r14.LJIIL = r1
            X.1zl r0 = r14.LIZLLL
            r3 = 0
            if (r0 == 0) goto L_0x010b
            boolean r0 = r0.LJIL()
        L_0x0071:
            java.lang.String r7 = "null cannot be cast to non-null type android.widget.FrameLayout"
            r13 = 0
            if (r0 == 0) goto L_0x00eb
            X.1Yb r8 = new X.1Yb
            X.1zl r0 = r14.LIZLLL
            if (r0 == 0) goto L_0x00e9
            com.bytedance.android.livesdkapi.depend.model.live.Room r6 = r0.LIZJ
            if (r6 != 0) goto L_0x0083
        L_0x0080:
            kotlin.h.b.n.LIZIZ()
        L_0x0083:
            android.widget.FrameLayout r2 = r14.LJIJ
            android.view.View r1 = r14.contentView
            java.util.Objects.requireNonNull(r1, r7)
            android.widget.FrameLayout r1 = (android.widget.FrameLayout) r1
            X.1zl r0 = r14.LIZLLL
            if (r0 == 0) goto L_0x0096
            X.1Un r13 = r0.LIZJ()
            if (r13 != 0) goto L_0x0099
        L_0x0096:
            kotlin.h.b.n.LIZIZ()
        L_0x0099:
            r8.<init>(r6, r2, r1, r13)
        L_0x009c:
            r14.LJ = r8
            com.bytedance.ies.sdk.datachannel.DataChannel r0 = r14.dataChannel
            kotlin.h.b.n.LIZIZ(r0, r5)
            r8.LIZ((com.bytedance.ies.sdk.datachannel.DataChannel) r0)
            X.0qs r0 = r14.LJ
            r2 = 1
            if (r0 == 0) goto L_0x00ae
            r0.LIZ((boolean) r2)
        L_0x00ae:
            X.1Om r1 = X.C31861Om.LIZ()
            java.lang.Integer r0 = java.lang.Integer.valueOf(r3)
            r1.LIZ((java.lang.Integer) r0)
            com.bytedance.ies.sdk.datachannel.DataChannel r1 = r14.dataChannel
            if (r1 == 0) goto L_0x00c8
            java.lang.Class<X.Fx2> r0 = X.Fx2.class
            java.lang.Object r0 = r1.LIZIZ(r0)
            if (r0 == 0) goto L_0x00c8
            r14.LIZJ((boolean) r2)
        L_0x00c8:
            X.0iY r1 = r14.LJIILLIIL
            X.PMp[] r0 = LIZIZ
            r0 = r0[r3]
            java.lang.Object r0 = r1.LIZ(r14, r0)
            X.1Yc r0 = (X.C34361Yc) r0
            if (r0 == 0) goto L_0x00d9
            r0.LIZ()
        L_0x00d9:
            X.0um r2 = X.C34411Yh.LJIIJ
            com.bytedance.ies.sdk.datachannel.DataChannel r1 = r14.dataChannel
            com.bytedance.android.livesdkapi.depend.model.live.Room r0 = r14.LJIILIIL
            X.0ue r0 = r2.LIZ(r1, r0, r4, r3)
            if (r0 == 0) goto L_0x00e8
            r0.LIZ()
        L_0x00e8:
            return
        L_0x00e9:
            r6 = r13
            goto L_0x0080
        L_0x00eb:
            X.1Vy r8 = new X.1Vy
            X.1zl r0 = r14.LIZLLL
            if (r0 == 0) goto L_0x0109
            com.bytedance.android.livesdkapi.depend.model.live.Room r9 = r0.LIZJ
        L_0x00f3:
            r10 = 0
            android.widget.FrameLayout r11 = r14.LJIJ
            android.view.View r12 = r14.contentView
            java.util.Objects.requireNonNull(r12, r7)
            android.widget.FrameLayout r12 = (android.widget.FrameLayout) r12
            X.1zl r0 = r14.LIZLLL
            if (r0 == 0) goto L_0x0105
            X.1Un r13 = r0.LIZJ()
        L_0x0105:
            r8.<init>(r9, r10, r11, r12, r13)
            goto L_0x009c
        L_0x0109:
            r9 = r13
            goto L_0x00f3
        L_0x010b:
            r0 = 0
            goto L_0x0071
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.android.live.liveinteract.multiguest.opt.widget.MultiGuestAsGuestWidget.onCreate():void");
    }

    public final void LIZ(C19950r3 r1) {
        M12.LIZ(r1);
        this.LJI = r1;
    }

    public final void LIZJ(boolean z) {
        C19840qs r0 = this.LJ;
        if (r0 != null) {
            r0.LIZIZ(z);
        }
    }

    public static void LIZ(C42651mZ r1) {
        r1.show();
        2fU.LIZ.LIZ(r1);
    }

    public final void LIZIZ(String str) {
        M12.LIZ(str);
        C19840qs r0 = this.LJ;
        if (r0 != null) {
            r0.LIZIZ(str);
        }
    }

    public static void LIZ(HK3 hk3) {
        hk3.show();
        2fU.LIZ.LIZ(hk3);
    }

    private final void LIZJ(String str) {
        C31161Lu r2 = new C31161Lu(this.context);
        r2.LJIJI = true;
        r2.LJIJ = false;
        r2.LIZ((CharSequence) str);
        r2.LIZ(2131830035, (C11170ct) C33721Vq.LIZ);
        LIZ(r2.LIZIZ());
    }

    public final void handleMsg(Message message) {
        C50831zl r2;
        M12.LIZ(message);
        if (isViewValid() && 140000 == message.what && (r2 = this.LIZLLL) != null) {
            r2.LIZJ("leave_with_background", false);
        }
    }

    public MultiGuestAsGuestWidget(FrameLayout frameLayout) {
        M12.LIZ(frameLayout);
        this.LJIJ = frameLayout;
    }

    public static void LIZ(LiveDialog liveDialog) {
        liveDialog.show();
        2fU.LIZ.LIZ(liveDialog);
    }

    public final void LIZIZ(Throwable th) {
        M12.LIZ(th);
        G0S.LIZ(this.context, th);
        C50831zl r2 = this.LIZLLL;
        if (r2 != null) {
            r2.LIZJ("join_channel_error", false);
        }
    }

    public final void LIZIZ(List<? extends LinkPlayerInfo> list) {
        boolean z;
        WeakReference<C33661Vk> weakReference;
        C33661Vk r0;
        WeakReference<C33661Vk> weakReference2;
        C33661Vk r5;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference3;
        LiveDialogFragment liveDialogFragment;
        DataChannel dataChannel;
        M12.LIZ(list);
        C50831zl r1 = this.LIZLLL;
        if (r1 != null) {
            z = r1.LJIL();
        } else {
            z = false;
        }
        if (z) {
            if (isViewValid() && (weakReference3 = this.LJIIIZ) != null && (liveDialogFragment = (LiveDialogFragment) weakReference3.get()) != null && liveDialogFragment.LJIIJ() && (dataChannel = this.dataChannel) != null) {
                dataChannel.LIZJ(C53922Bi.class, list);
            }
        } else if (isViewValid() && (weakReference = this.LIZJ) != null && (r0 = (C33661Vk) weakReference.get()) != null && r0.isShowing() && (weakReference2 = this.LIZJ) != null && (r5 = (C33661Vk) weakReference2.get()) != null) {
            List LIZLLL2 = Ls0.LIZLLL(list);
            if (LIZLLL2 != null) {
                AnonymousClass1UP r4 = r5.LIZIZ;
                ArrayList arrayList = new ArrayList();
                for (Object next : LIZLLL2) {
                    if (((LinkPlayerInfo) next).LIZLLL == 1) {
                        arrayList.add(next);
                    }
                }
                r4.LIZ((List<LinkPlayerInfo>) arrayList);
                r5.LIZLLL();
                return;
            }
            try {
                throw new IllegalArgumentException("Required value was null.".toString());
            } catch (IllegalArgumentException unused) {
            }
        }
    }

    public final void LIZ(C19320q2 r11) {
        User user;
        M12.LIZ(r11);
        Throwable th = r11.LIZ;
        C43231nV.LIZIZ(false, th.toString());
        if (!(th instanceof AnonymousClass1JF)) {
            G0S.LIZ(this.context, th);
            return;
        }
        AnonymousClass1JF r1 = (AnonymousClass1JF) th;
        switch (r1.getErrorCode()) {
            case 20048:
                String LIZ = C10000b0.LIZ(2131829361);
                n.LIZIZ(LIZ, "");
                String LIZ2 = AnonymousClass0HH.LIZ(LIZ, Arrays.copyOf(new Object[]{String.valueOf(LiveAudienceLinkmicLowestAgeSetting.INSTANCE.getValue())}, 1));
                n.LIZIZ(LIZ2, "");
                HK2 hk2 = new HK2(getContext());
                hk2.LJIIIZ = true;
                hk2.LIZIZ = LIZ2;
                hk2.LIZ(2131833777, new C19670qb(this), false);
                hk2.LIZIZ(2131833778, C19680qc.LIZ, false);
                LIZ(hk2.LIZ());
                C24290y3.LIZ();
                return;
            case 31002:
                7Vw r0 = (7Vw) AnonymousClass0UO.LIZIZ.LIZ(r1.getExtra(), 7Vw.class);
                if (r0 != null) {
                    List list = r0.LIZ;
                    String str = r0.LIZIZ;
                    if (list == null || list.isEmpty()) {
                        Fz8.LIZ(C10000b0.LJ(), 2131833850);
                        return;
                    } else {
                        LIZ(true, list, str);
                        return;
                    }
                } else {
                    return;
                }
            case 31011:
                C50831zl r02 = this.LIZLLL;
                if (r02 != null) {
                    r02.LJIJ();
                    return;
                }
                return;
            case 4003036:
                Fz8.LIZ(C10000b0.LJ(), C10000b0.LIZ(2131829489), 0);
                return;
            case 4003037:
                C50831zl r2 = this.LIZLLL;
                if (r2 != null) {
                    r2.LIZ(this.context, C14780ii.BAN_FOR_BROADCASTING);
                    return;
                }
                return;
            case 4003088:
                int i = r11.LIZIZ;
                Activity LIZ3 = C10180bI.LIZ(this.context);
                if (LIZ3 != null) {
                    n.LIZIZ(LIZ3, "");
                    ((IBroadcastService) C11100cm.LIZ(IBroadcastService.class)).showGuideBirthdayEditDialog(LIZ3, "live_co_host", C24290y3.LIZLLL(i), new C33701Vo(this, i));
                    C24290y3.LIZIZ(i);
                    return;
                }
                return;
            case 4003089:
                int i2 = r11.LIZIZ;
                SpannableString spannableString = new SpannableString(C10000b0.LIZ(2131828211));
                spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#FE2C55")), 0, spannableString.length(), 33);
                Room room = (Room) this.dataChannel.LIZIZ(Fv7.class);
                C31161Lu r8 = new C31161Lu(this.context);
                r8.LJIJI = false;
                r8.LJIJ = false;
                r8.LIZJ = C10000b0.LIZ(2131828213, String.valueOf(LiveBroadcastAgeThresholdSetting.INSTANCE.getValue()));
                String LIZ4 = C10000b0.LIZ(2131828212);
                n.LIZIZ(LIZ4, "");
                String LIZ5 = y.LIZ(LIZ4, "{username}", "%s");
                Object[] objArr = new Object[1];
                if (room != null) {
                    user = room.getOwner();
                } else {
                    user = null;
                }
                objArr[0] = C07930Ul.LIZ(user);
                String LIZ6 = AnonymousClass0HH.LIZ(LIZ5, Arrays.copyOf(objArr, 1));
                n.LIZIZ(LIZ6, "");
                r8.LIZ((CharSequence) LIZ6);
                r8.LIZ(2131829017, (C11170ct) new C33691Vn(i2));
                LiveDialog LIZIZ2 = r8.LIZIZ();
                C11190cv r12 = new C11190cv();
                r12.LIZ = spannableString;
                r12.LIZIZ = new C19660qa(this, LIZIZ2, i2);
                LIZIZ2.LIZ((C11180cu) r12.LIZ());
                LIZ(LIZIZ2);
                C24290y3.LIZ(i2);
                return;
            default:
                G0S.LIZ(this.context, th);
                return;
        }
    }

    public final void LIZIZ(boolean z) {
        int i;
        C33431Un LIZJ2;
        C34361Yc LIZ = C34361Yc.LIZIZ.LIZ();
        if (LIZ != null) {
            LIZ.LIZJ();
        }
        Glh LIZIZ2 = H7d.LIZ().LIZIZ();
        n.LIZIZ(LIZIZ2, "");
        boolean z2 = false;
        if (!LIZIZ2.LJ()) {
            Glh LIZIZ3 = H7d.LIZ().LIZIZ();
            Context context = this.context;
            Gg2 LIZ2 = Gg3.LIZ();
            LIZ2.LIZ = C10000b0.LIZ(2131833951);
            LIZ2.LIZLLL = "interact";
            LIZ2.LIZJ = 0;
            LIZIZ3.LIZ(context, LIZ2.LIZ()).LIZ(getAutoUnbindTransformer()).LIZIZ(new Gb7());
        } else if (!H7d.LIZ().LIZIZ().LIZ(Gio.INTERACT)) {
            if (C21140sy.LJFF()) {
                Fz8.LIZ(C10000b0.LJ(), 2131828338);
            } else if (C21140sy.LIZJ(this.LJIILIIL)) {
                Fz8.LIZ(C10000b0.LJ(), 2131830517);
            } else {
                Room room = this.LJIILIIL;
                if (room == null || room.getMosaicStatus() != 1) {
                    if (z) {
                        this.LJII = null;
                    }
                    C50831zl r0 = this.LIZLLL;
                    if (r0 == null || !r0.LJIL()) {
                        C50831zl r02 = this.LIZLLL;
                        if (r02 == null || (LIZJ2 = r02.LIZJ()) == null) {
                            i = 0;
                        } else {
                            i = LIZJ2.LJFF();
                        }
                        C34361Yc LIZ3 = C34361Yc.LIZIZ.LIZ();
                        if (LIZ3 != null) {
                            z2 = n.LIZ(LIZ3.LIZ, "1");
                        }
                        if (i <= 0 || z2) {
                            C31861Om LIZ4 = C31861Om.LIZ();
                            n.LIZIZ(LIZ4, "");
                            Integer num = (Integer) LIZ4.LJIILIIL;
                            if (num != null && num.intValue() == 0) {
                                LJIILIIL();
                                return;
                            }
                        }
                        C50831zl r03 = this.LIZLLL;
                        if (r03 != null) {
                            r03.LJIJI();
                            return;
                        }
                        return;
                    }
                    LJIILIIL();
                    return;
                }
                Fz8.LIZ(C10000b0.LJ(), 2131833992);
            }
        }
    }

    public final void LIZ(C22780vc r2) {
        M12.LIZ(r2);
        C19840qs r0 = this.LJ;
        if (r0 != null) {
            r0.LIZ(r2);
        }
    }

    public final void LIZ(C34131Xf r17) {
        int i;
        int i2;
        int i3;
        DialogFragment dialogFragment;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog;
        Integer num;
        C33431Un LIZJ2;
        LiveDialogFragment liveDialogFragment;
        Fragment fragment;
        Fragment fragment2;
        DialogFragment dialogFragment2;
        BaseFragment baseFragment;
        Boolean bool;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog2;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog3;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog4;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog5;
        DialogFragment dialogFragment3;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog6;
        WeakReference<MultiLiveGuestUserInfoDialog> weakReference = this.LJIIIZ;
        Fragment fragment3 = null;
        if (!(weakReference == null || (liveDialogFragment = (LiveDialogFragment) weakReference.get()) == null || !liveDialogFragment.LJIIJ())) {
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJIIIZ;
            if (weakReference2 == null || (multiLiveGuestUserInfoDialog6 = (MultiLiveGuestUserInfoDialog) weakReference2.get()) == null) {
                fragment = null;
            } else {
                fragment = multiLiveGuestUserInfoDialog6.LJ;
            }
            if (fragment instanceof MultiGuestUserInfoFragment) {
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference3 = this.LJIIIZ;
                if (!(weakReference3 == null || (dialogFragment3 = (DialogFragment) weakReference3.get()) == null)) {
                    dialogFragment3.dismiss();
                }
            } else {
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference4 = this.LJIIIZ;
                if (weakReference4 == null || (multiLiveGuestUserInfoDialog5 = (MultiLiveGuestUserInfoDialog) weakReference4.get()) == null) {
                    fragment2 = null;
                } else {
                    fragment2 = multiLiveGuestUserInfoDialog5.LJ;
                }
                if (fragment2 instanceof MultiGuestPreviewFragment) {
                    WeakReference<MultiLiveGuestUserInfoDialog> weakReference5 = this.LJIIIZ;
                    if (weakReference5 == null || (multiLiveGuestUserInfoDialog4 = (MultiLiveGuestUserInfoDialog) weakReference5.get()) == null) {
                        baseFragment = null;
                    } else {
                        baseFragment = multiLiveGuestUserInfoDialog4.LJ;
                    }
                    Objects.requireNonNull(baseFragment, "null cannot be cast to non-null type com.bytedance.android.live.liveinteract.multilive.guset.fragment.MultiGuestPreviewFragment");
                    BaseFragment baseFragment2 = baseFragment;
                    if (baseFragment2 != null) {
                        bool = Boolean.valueOf(baseFragment2.isViewValid());
                    } else {
                        bool = null;
                    }
                    if (bool.booleanValue()) {
                        this.LJI = C19950r3.GO_LIVE;
                        WeakReference<MultiLiveGuestUserInfoDialog> weakReference6 = this.LJIIIZ;
                        if (!(weakReference6 == null || (multiLiveGuestUserInfoDialog3 = (MultiLiveGuestUserInfoDialog) weakReference6.get()) == null)) {
                            multiLiveGuestUserInfoDialog3.LIZ(this.LJI, this.LJII);
                        }
                        WeakReference<MultiLiveGuestUserInfoDialog> weakReference7 = this.LJIIIZ;
                        if (!(weakReference7 == null || (multiLiveGuestUserInfoDialog2 = (MultiLiveGuestUserInfoDialog) weakReference7.get()) == null)) {
                            fragment3 = multiLiveGuestUserInfoDialog2.LJ;
                        }
                        Objects.requireNonNull(fragment3, "null cannot be cast to non-null type com.bytedance.android.live.liveinteract.multilive.guset.fragment.MultiGuestPreviewFragment");
                        ((MultiGuestPreviewFragment) fragment3).LIZJ();
                        return;
                    }
                }
                WeakReference<MultiLiveGuestUserInfoDialog> weakReference8 = this.LJIIIZ;
                if (!(weakReference8 == null || (dialogFragment2 = (DialogFragment) weakReference8.get()) == null)) {
                    dialogFragment2.dismiss();
                }
            }
        }
        this.LJI = C19950r3.GO_LIVE;
        C50831zl r1 = this.LIZLLL;
        if (r1 != null) {
            fragment3 = r1.LIZJ;
        }
        C50831zl r12 = this.LIZLLL;
        if (r12 == null || (LIZJ2 = r12.LIZJ()) == null) {
            i = 0;
        } else {
            i = LIZJ2.LJI();
        }
        C42511mL r4 = new C42511mL(fragment3, false, (List<Po7>) null, "", i, this.dataChannel);
        C22120uY r2 = this.LJII;
        if (r2 == null || (num = r2.LIZ) == null) {
            i2 = -1;
        } else {
            i2 = num.intValue();
        }
        Integer valueOf = Integer.valueOf(i2);
        C19840qs r13 = this.LJ;
        if (r13 != null) {
            i3 = r13.LJ();
        } else {
            i3 = -1;
        }
        C22120uY r10 = new C22120uY(valueOf, i3, 0, 0, 12);
        C22310ur r5 = MultiLiveGuestUserInfoDialog.LJIIIIZZ;
        DataChannel dataChannel = this.dataChannel;
        n.LIZIZ(dataChannel, "");
        this.LJIIIZ = new WeakReference<>(r5.LIZ(dataChannel, (AnonymousClass1US) r4, (WeakReference<C41721l4>) new WeakReference(this.LIZLLL), this.LJI, r10, "anchor_permit"));
        AnonymousClass0AA LJIILJJIL2 = LJIILJJIL();
        if (LJIILJJIL2 != null) {
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference9 = this.LJIIIZ;
            if (!(weakReference9 == null || (multiLiveGuestUserInfoDialog = (MultiLiveGuestUserInfoDialog) weakReference9.get()) == null)) {
                multiLiveGuestUserInfoDialog.LIZ(this.LJI, this.LJII);
            }
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference10 = this.LJIIIZ;
            if (!(weakReference10 == null || (dialogFragment = (DialogFragment) weakReference10.get()) == null)) {
                dialogFragment.show(LJIILJJIL2, "MultiLiveGuestUserInfoDialog");
            }
        }
        C21810u3.LIZIZ.LIZ("guest_apply_anchor", "0");
    }

    public final void LIZIZ(String str, SurfaceView surfaceView) {
        M12.LIZ(str, surfaceView);
        C19840qs r0 = this.LJ;
        if (r0 != null) {
            r0.LIZ(str, surfaceView);
        }
    }

    private final void LIZ(boolean z, List<? extends Po7> list, String str) {
        boolean z2;
        Room room;
        int i;
        C42651mZ r0;
        int i2;
        int i3;
        DialogFragment dialogFragment;
        MultiLiveGuestUserInfoDialog multiLiveGuestUserInfoDialog;
        Integer num;
        LiveDialogFragment liveDialogFragment;
        C33431Un LIZJ2;
        C50831zl r02 = this.LIZLLL;
        if (r02 != null) {
            z2 = r02.LJIL();
        } else {
            z2 = false;
        }
        C50831zl r03 = this.LIZLLL;
        if (r03 != null) {
            room = r03.LIZJ;
        } else {
            room = null;
        }
        C50831zl r04 = this.LIZLLL;
        if (r04 == null || (LIZJ2 = r04.LIZJ()) == null) {
            i = 0;
        } else {
            i = LIZJ2.LJI();
        }
        boolean z3 = z;
        C42511mL r5 = new C42511mL(room, z3, list, str, i, this.dataChannel);
        if (z2) {
            WeakReference<MultiLiveGuestUserInfoDialog> weakReference = this.LJIIIZ;
            if (weakReference == null || (liveDialogFragment = (LiveDialogFragment) weakReference.get()) == null || !liveDialogFragment.LJIIJ()) {
                C22120uY r1 = this.LJII;
                if (r1 == null || (num = r1.LIZ) == null) {
                    i2 = -1;
                } else {
                    i2 = num.intValue();
                }
                Integer valueOf = Integer.valueOf(i2);
                C19840qs r05 = this.LJ;
                if (r05 != null) {
                    i3 = r05.LJ();
                } else {
                    i3 = -1;
                }
                C22120uY r6 = new C22120uY(valueOf, i3, 0, 0, 12);
                C22310ur r7 = MultiLiveGuestUserInfoDialog.LJIIIIZZ;
                DataChannel dataChannel = this.dataChannel;
                n.LIZIZ(dataChannel, "");
                this.LJIIIZ = new WeakReference<>(r7.LIZ(dataChannel, (AnonymousClass1US) r5, (WeakReference<C41721l4>) new WeakReference(this.LIZLLL), this.LJI, r6, "anchor_invite"));
                AnonymousClass0AA LJIILJJIL2 = LJIILJJIL();
                if (LJIILJJIL2 != null) {
                    WeakReference<MultiLiveGuestUserInfoDialog> weakReference2 = this.LJIIIZ;
                    if (!(weakReference2 == null || (multiLiveGuestUserInfoDialog = (MultiLiveGuestUserInfoDialog) weakReference2.get()) == null)) {
                        multiLiveGuestUserInfoDialog.LIZ(this.LJI, this.LJII);
                    }
                    WeakReference<MultiLiveGuestUserInfoDialog> weakReference3 = this.LJIIIZ;
                    if (weakReference3 != null && (dialogFragment = (DialogFragment) weakReference3.get()) != null) {
                        dialogFragment.show(LJIILJJIL2, "MultiLiveGuestUserInfoDialog");
                        return;
                    }
                    return;
                }
                return;
            }
            return;
        }
        C42651mZ r06 = this.LJIIJ;
        if (r06 == null || !r06.isShowing()) {
            C42651mZ r3 = new C42651mZ(G2l.LIZ(this.context), r5, this.dataChannel, this.LJI);
            this.LJIIJ = r3;
            LIZ(r3);
            if (this.LJI == C19950r3.GO_LIVE && (r0 = this.LJIIJ) != null) {
                r0.setCancelable(false);
            }
            C42651mZ r12 = this.LJIIJ;
            Objects.requireNonNull(r12, "null cannot be cast to non-null type com.bytedance.android.live.liveinteract.multiguest.ui.dialog.InteractApplyDialogMt");
            r12.LJIILIIL = this.LJIILL;
        }
    }
}
