package com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices;

import X.0AA;
import X.0HH;
import X.19Y;
import X.1hK;
import X.2HN;
import X.2Pr;
import X.2gN;
import X.2tE;
import X.3Ll;
import X.3Mn;
import X.3Mp;
import X.3Q4;
import X.3SC;
import X.3UB;
import X.3VC;
import X.3Vc;
import X.3Vf;
import X.3WQ;
import X.3g6;
import X.3qa;
import X.3sB;
import X.4nL;
import X.4qW;
import X.4qe;
import X.4r1;
import X.4tr;
import X.4uH;
import X.7he;
import X.8li;
import X.8lq;
import X.9Eh;
import X.9Gf;
import X.9H6;
import X.9JE;
import X.9JF;
import X.B7i;
import X.BGN;
import X.C0628IOd;
import X.C0686IQj;
import X.C0806IUz;
import X.C0911IZa;
import X.C0937Ia0;
import X.C0953IaG;
import X.C0954IaH;
import X.C0962IaP;
import X.C0986Ian;
import X.C0995Iaw;
import X.C1003Ib4;
import X.C1096IcZ;
import X.C1103Icg;
import X.C1104Ich;
import X.C1130Id7;
import X.C1158IdZ;
import X.C1173Ido;
import X.C1194Ie9;
import X.C1195IeA;
import X.C1344IgZ;
import X.C1357Igm;
import X.C1426Iht;
import X.C1477Iii;
import X.C1499Ij4;
import X.C1504Ij9;
import X.C1505IjA;
import X.C1506IjB;
import X.C1507IjC;
import X.C1510IjF;
import X.C1513IjI;
import X.C1514IjJ;
import X.C1523IjS;
import X.C1527IjW;
import X.C1529IjY;
import X.C1530IjZ;
import X.C1531Ija;
import X.C1546Ijp;
import X.C1549Ijs;
import X.C1561Ik4;
import X.C1596Ikd;
import X.C1598Ikf;
import X.C1802Inx;
import X.C1925Ipw;
import X.C1955IqQ;
import X.C2177Iu0;
import X.C2190IuD;
import X.C2756J7z;
import X.C4175Jl8;
import X.C4190JlN;
import X.CqM;
import X.Crj;
import X.Cv9;
import X.D8s;
import X.DAe;
import X.DAj;
import X.DCr;
import X.DE3;
import X.DE5;
import X.DE6;
import X.DsE;
import X.EGQ;
import X.EIk;
import X.ESC;
import X.EcI;
import X.EeH;
import X.Erw;
import X.EwK;
import X.FEh;
import X.FHw;
import X.FNZ;
import X.Frf;
import X.IA0;
import X.IBA;
import X.IPB;
import X.IV2;
import X.IZ2;
import X.IZE;
import X.J1B;
import X.JAY;
import X.Lnj;
import X.Ls0;
import X.LsC;
import X.LsD;
import X.Lw4;
import X.M12;
import X.MK9;
import X.PZq;
import X.RN3;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.keva.Keva;
import com.bytedance.router.SmartRoute;
import com.bytedance.router.SmartRouter;
import com.ss.android.ugc.aweme.di.ImEntranceService;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.framework.services.IUserService;
import com.ss.android.ugc.aweme.im.sdk.activitystatus.ActivityStatusViewModelImpl;
import com.ss.android.ugc.aweme.im.sdk.chat.analytics.IMNaviAnalyticsImpl;
import com.ss.android.ugc.aweme.im.sdk.chat.data.model.BaseContent;
import com.ss.android.ugc.aweme.im.sdk.chat.feature.reply.feature.feed.DetailFeedKeyboardDialogFragment;
import com.ss.android.ugc.aweme.im.sdk.chat.feature.story.StoryDmDialogFragment;
import com.ss.android.ugc.aweme.im.sdk.chat.ui.activity.ChatRoomActivity;
import com.ss.android.ugc.aweme.im.sdk.chatlist.controller.helper.SessionListNavArg;
import com.ss.android.ugc.aweme.im.sdk.chatlist.ui.fragment.SessionListFragment;
import com.ss.android.ugc.aweme.im.sdk.chatlist.ui.fragment.SessionListFragmentV2;
import com.ss.android.ugc.aweme.im.sdk.relations.ui.activity.RelationSelectActivity;
import com.ss.android.ugc.aweme.im.service.IIMService;
import com.ss.android.ugc.aweme.im.service.model.IMContact;
import com.ss.android.ugc.aweme.im.service.model.IMConversation;
import com.ss.android.ugc.aweme.im.service.model.IMUser;
import com.ss.android.ugc.aweme.im.service.model.NoticePushMessage;
import com.ss.android.ugc.aweme.im.service.service.IImInboxDmService;
import com.ss.android.ugc.aweme.profile.model.FollowStatus;
import com.ss.android.ugc.aweme.profile.model.User;
import com.ss.android.ugc.aweme.services.BaseUserService;
import com.ss.android.ugc.aweme.sharer.ui.SharePackage;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CopyOnWriteArrayList;
import kotlin.h.b.n;
import org.greenrobot.eventbus.EventBus;

public final class IMService implements IIMService {
    public static final Companion Companion = new Companion((2HN) null);
    public static IIMService inst;
    public final Crj performanceService$delegate = 7he.LIZ(IMService$performanceService$2.INSTANCE);

    static {
        Covode.recordClassIndex(86060);
    }

    public static final IIMService get() {
        return Companion.get();
    }

    public static final IIMService inst() {
        return Companion.inst();
    }

    public final void cacheRecentShareContact(IMContact iMContact) {
    }

    public final 3WQ getPerformanceService() {
        return (3WQ) this.performanceService$delegate.getValue();
    }

    public final boolean isIMAvailable() {
        return true;
    }

    public final void registerLifeCycle(Application application) {
        M12.LIZ(application);
    }

    public final void showNoticePush(NoticePushMessage noticePushMessage) {
    }

    public final C1561Ik4 getActivityStatusAnalytics() {
        return 3Ll.LIZ;
    }

    public final C1529IjY getIMErrorMonitor() {
        return C1514IjJ.LIZ;
    }

    public final J1B getImNaviAnalytics() {
        return IMNaviAnalyticsImpl.LIZ;
    }

    public final 3Vf getImSayhiAnalytics() {
        return 3Vc.LIZ;
    }

    public final void clearIMNotification() {
        C1158IdZ.LIZJ.LIZIZ();
    }

    public final void ensureIMState() {
        JAY.LIZ().LIZIZ();
    }

    public final void forcePullMessageByUser() {
        C1925Ipw.LIZ.LIZ();
    }

    public final C1598Ikf getActivityStatusViewModel() {
        return ActivityStatusViewModelImpl.LJII.LIZ();
    }

    public final EeH getFamiliarService() {
        return IMServiceProvider.INSTANCE.getFamiliarService();
    }

    public final FHw getImParser() {
        return new PZq();
    }

    public final DsE getInboxAdapterService() {
        return IMServiceProvider.INSTANCE.getInboxAdapterService();
    }

    public final IImInboxDmService getInboxDmService() {
        return IMServiceProvider.INSTANCE.getImInboxDmService();
    }

    public final 2gN getMessagingGeckoUtils() {
        return new C2756J7z();
    }

    public final EGQ getRelationService() {
        return IMServiceProvider.INSTANCE.getRelationService();
    }

    public final C1531Ija getSendMessageTemplateService() {
        return SendMessageTemplateServiceImpl.Companion.getINSTANCE();
    }

    public final 4qW getShareService() {
        return IMServiceProvider.INSTANCE.getShareService();
    }

    public final EIk getSystemEmojiService() {
        return IMServiceProvider.INSTANCE.getSystemSmallEmojiService();
    }

    public final boolean isConversationListPagination() {
        return IZ2.LIZ.LIZ();
    }

    public final boolean isNotificationMessageQueueEmpty() {
        return C1158IdZ.LIZJ.LIZJ();
    }

    public final void refreshLoginState() {
        C1103Icg.LJ.LIZLLL();
    }

    public final void updateStrangerBox() {
        C1096IcZ.LIZ().LIZIZ();
    }

    public final int getFriendsCount() {
        return IPB.LIZ().LIZLLL();
    }

    public final boolean isFilteredRequestSettingsEnabled() {
        if (C1477Iii.LIZ.LIZ() == 2) {
            return true;
        }
        return false;
    }

    public final boolean isMtInnerPushEnabled() {
        C0686IQj LIZ = C0686IQj.LIZ();
        n.LIZIZ(LIZ, "");
        return LIZ.LJIIJ();
    }

    public final boolean isNeedToContinuePlayInAct() {
        return C1103Icg.LJ.LIZ().isNeedToContinuePlayInAct();
    }

    public final boolean isNotificationShowing() {
        C1195IeA ieA = C1173Ido.LIZIZ.LIZIZ().LIZIZ;
        if (ieA != null) {
            return ieA.LIZ;
        }
        return false;
    }

    public final void onBlockUserSuccessEvent() {
        CqM.LIZ(new C1523IjS());
    }

    public final void onInboxTabClicked() {
        if (EcI.LIZ.LIZIZ()) {
            IV2.LIZIZ.LIZ(System.currentTimeMillis());
        }
    }

    public final void resetLoginState() {
        C1103Icg icg = C1103Icg.LJ;
        if (3Mp.LIZ()) {
            IBA.LIZJ();
        }
        icg.LIZLLL();
    }

    public IMService() {
        ImEntranceService.LIZ().init(this);
    }

    public final List<IMUser> getAllFollowIMUsers() {
        C0628IOd LIZ = IPB.LIZ();
        String LJ = IPB.LJ();
        n.LIZIZ(LJ, "");
        List<IMUser> LIZLLL = LIZ.LIZLLL(LJ);
        Objects.requireNonNull(LIZLLL, "null cannot be cast to non-null type kotlin.collections.MutableList<com.ss.android.ugc.aweme.im.service.model.IMUser>");
        return Ls0.LIZLLL(LIZLLL);
    }

    public final List<IMUser> getAllFriends() {
        C0628IOd LIZ = IPB.LIZ();
        String LIZIZ = IPB.LIZIZ();
        n.LIZIZ(LIZIZ, "");
        List<IMUser> LIZLLL = LIZ.LIZLLL(LIZIZ);
        Objects.requireNonNull(LIZLLL, "null cannot be cast to non-null type kotlin.collections.MutableList<com.ss.android.ugc.aweme.im.service.model.IMUser>");
        return Ls0.LIZLLL(LIZLLL);
    }

    public final List<DE6> getMostSharedPlatformTarget() {
        DE5 de5 = DE5.LIZIZ;
        Keva repo = Keva.getRepo("share_video_recent_records" + de5.LIZ());
        n.LIZIZ(repo, "");
        return de5.LIZ(repo);
    }

    public final void switchLocale() {
        if (IZ2.LIZ.LIZ()) {
            if (C0953IaG.LJIILLIIL != null && C0953IaG.LJIIZILJ) {
                C0953IaG iaG = C0953IaG.LJIILLIIL;
                if (iaG != null) {
                    iaG.LJFF = true;
                }
                3Q4.LIZIZ("SessionListManagerV2", "switchLocal set mSortIMAtNext true");
            }
        } else if (C0954IaH.LJIIJ != null && C0954IaH.LJIIJJI) {
            C0954IaH iaH = C0954IaH.LJIIJ;
            if (iaH != null) {
                iaH.LJFF = true;
            }
            3Q4.LIZIZ("SessionListManager", "switchLocal set mSortIMAtNext true");
        }
    }

    public final List<IMUser> getRecentIMUsers() {
        ArrayList arrayList = new ArrayList();
        List arrayList2 = new ArrayList(C1003Ib4.LIZ.LIZ().LIZ());
        ArrayList arrayList3 = (ArrayList) arrayList2;
        Iterator it = arrayList3.iterator();
        n.LIZIZ(it, "");
        while (it.hasNext()) {
            C4190JlN jlN = (C4190JlN) it.next();
            n.LIZIZ(jlN, "");
            C4175Jl8 lastMessage = jlN.getLastMessage();
            long LIZJ = C0937Ia0.LIZ.LIZJ(jlN.getConversationId());
            if (jlN.getConversationType() != RN3.LIZ || lastMessage == null || lastMessage.getMsgType() == 15 || LIZJ <= 0) {
                it.remove();
            }
        }
        int size = arrayList2.size();
        List<C4190JlN> list = arrayList2;
        if (size > 10) {
            List subList = arrayList3.subList(0, 10);
            n.LIZIZ(subList, "");
            list = subList;
        }
        for (C4190JlN LIZJ2 : list) {
            IMUser LIZJ3 = C0911IZa.LIZJ(LIZJ2);
            if (LIZJ3 != null) {
                LIZJ3.setType(1);
                arrayList.add(LIZJ3);
            }
        }
        return Ls0.LIZLLL(arrayList);
    }

    public final void setNeedToContinuePlayInAct(boolean z) {
        C1103Icg.LJ.LIZ().setNeedToContinueToPlay(z);
    }

    public final void showIMNotification(boolean z) {
        if (!z) {
            C1173Ido.LIZIZ.LIZ(0);
        }
    }

    public final void updateIMUserFollowStatus(IMUser iMUser) {
        DAe.LIZ(3SC.LIZ, DCr.LIZLLL, new IMService$updateIMUserFollowStatus$1(this, iMUser, (4r1) null), 2);
    }

    public final boolean isButtonShowSayhi(String str) {
        M12.LIZ(str);
        if (!C1499Ij4.LIZ.LIZ(str, C1499Ij4.LIZ.LIZ())) {
            return true;
        }
        return false;
    }

    public final void setKeyMtInnerPushSwitchOn(boolean z) {
        C0686IQj LIZ = C0686IQj.LIZ();
        n.LIZIZ(LIZ, "");
        LIZ.LIZ.edit().putBoolean("key_mt_inner_push_switch_on", z).apply();
    }

    public final void updateChatUserSetting(int i) {
        3qa r0;
        C0686IQj LIZ = C0686IQj.LIZ();
        n.LIZIZ(LIZ, "");
        3qa LJIIJJI = LIZ.LJIIJJI();
        if (LJIIJJI != null) {
            r0 = 3qa.copy$default(LJIIJJI, i, 0, 0, 4, (Object) null);
        } else {
            r0 = null;
        }
        LIZ.LIZ(r0);
    }

    public final void updateContactName(IMUser iMUser) {
        IMUser LIZ;
        if (iMUser != null && (LIZ = IBA.LIZ(iMUser.getUid(), iMUser.getSecUid())) != null) {
            iMUser.setContactName(LIZ.getContactName());
        }
    }

    public final String getConversationId(String str) {
        if (str == null || str.length() <= 0) {
            return "";
        }
        C1103Icg.LJ.LJ();
        C1104Ich ich = C0937Ia0.LIZ;
        Long valueOf = Long.valueOf(str);
        n.LIZIZ(valueOf, "");
        String LIZ = ich.LIZ(valueOf.longValue());
        if (LIZ == null) {
            return "";
        }
        return LIZ;
    }

    public final boolean getFollowRequestedStatus(String str) {
        M12.LIZ(str);
        C1499Ij4 ij4 = C1499Ij4.LIZ;
        M12.LIZ(str);
        Keva LIZ = ij4.LIZ();
        if (!LIZ.contains("key_double_follow_time_stamp".concat(String.valueOf(str)))) {
            return LIZ.getBoolean("key_follow_requested_status".concat(String.valueOf(str)), false);
        }
        LIZ.erase("key_follow_requested_status".concat(String.valueOf(str)));
        return false;
    }

    public final String getIMContactConversationId(IMContact iMContact) {
        M12.LIZ(iMContact);
        M12.LIZ(iMContact);
        if (iMContact instanceof IMConversation) {
            return ((IMConversation) iMContact).getConversationId();
        }
        if (!(iMContact instanceof IMUser)) {
            return null;
        }
        String uid = ((IMUser) iMContact).getUid();
        n.LIZIZ(uid, "");
        return C0937Ia0.LIZ.LIZ(Long.parseLong(uid));
    }

    public final String getIMContactUserId(IMContact iMContact) {
        M12.LIZ(iMContact);
        M12.LIZ(iMContact);
        if (iMContact instanceof IMUser) {
            return ((IMUser) iMContact).getUid();
        }
        if (!(iMContact instanceof IMConversation)) {
            return null;
        }
        IMConversation iMConversation = (IMConversation) iMContact;
        if (iMConversation.getConversationType() == RN3.LIZ) {
            return String.valueOf(C0937Ia0.LIZ.LIZJ(iMConversation.getConversationId()));
        }
        return null;
    }

    public final Intent getSessionListActivityIntent(Context context) {
        Class cls;
        M12.LIZ(context);
        if (EcI.LIZ.LIZIZ()) {
            Intent intent = new Intent();
            intent.setClassName(context, "com.ss.android.ugc.aweme.splash.SplashActivity");
            intent.setFlags(67108864);
            intent.putExtra("com.ss.android.ugc.aweme.intent.extra.EXTRA_AWEME_PUSH_TAB", "NOTIFICATION");
            return intent;
        }
        if (IZ2.LIZ.LIZ()) {
            cls = SessionListFragmentV2.class;
        } else {
            cls = SessionListFragment.class;
        }
        return FNZ.LIZ.LIZ(context, cls, (Bundle) null);
    }

    public final void recordExternalPlatformVideoShare(String str) {
        M12.LIZ(str);
        DE5 de5 = DE5.LIZIZ;
        Keva repo = Keva.getRepo("share_video_recent_records" + de5.LIZ());
        n.LIZIZ(repo, "");
        Cv9 LIZ = DAj.LIZ(DCr.LIZLLL);
        M12.LIZ(str, repo, LIZ);
        DE5.LIZ = null;
        DAe.LIZ(LIZ, (D8s) null, new DE3(str, repo, (4r1) null), 3);
    }

    public final void removeUidFromRecentVideoSharedRecords(List<String> list) {
        M12.LIZ(list);
        DE5 de5 = DE5.LIZIZ;
        Keva repo = Keva.getRepo("share_video_recent_records" + de5.LIZ());
        n.LIZIZ(repo, "");
        de5.LIZ(list, repo);
    }

    public final void updateIMUser(IMUser iMUser) {
        if (iMUser == null || iMUser.getUid() == null) {
            M12.LIZ("follow_status", "IMService.updateSimpleUser user = null");
            return;
        }
        if (iMUser.isBlock()) {
            iMUser.setFollowStatus(0);
        }
        DAe.LIZ(3SC.LIZ, DCr.LIZLLL, new IMService$updateIMUser$1(this, iMUser, (4r1) null), 2);
    }

    public static IIMService createIIMServicebyMonsterPlugin(boolean z) {
        MethodCollector.i(1803);
        IIMService iIMService = (IIMService) Lnj.LIZ(IIMService.class, z);
        if (iIMService != null) {
            MethodCollector.o(1803);
            return iIMService;
        }
        Object LIZIZ = Lnj.LIZIZ(IIMService.class, z);
        if (LIZIZ != null) {
            IIMService iIMService2 = (IIMService) LIZIZ;
            MethodCollector.o(1803);
            return iIMService2;
        }
        if (Lnj.LLLILZ == null) {
            synchronized (IIMService.class) {
                try {
                    if (Lnj.LLLILZ == null) {
                        Lnj.LLLILZ = new IMService();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(1803);
                    throw th;
                }
            }
        }
        IMService iMService = (IMService) Lnj.LLLILZ;
        MethodCollector.o(1803);
        return iMService;
    }

    public final boolean startChat(C1505IjA ijA) {
        Activity activity;
        M12.LIZ(ijA);
        Activity activity2 = null;
        DAe.LIZ(DAj.LIZ(DCr.LIZLLL), (D8s) null, new C0806IUz(System.currentTimeMillis(), (4r1) null), 3);
        C1507IjC.LIZ(ijA);
        Context context = ijA.getContext();
        if (context != null) {
            while (true) {
                if (!(context instanceof Activity)) {
                    if (context instanceof ContextWrapper) {
                        context = ((ContextWrapper) context).getBaseContext();
                        if (context == null) {
                            break;
                        }
                    } else {
                        break;
                    }
                } else {
                    activity = (Activity) context;
                    break;
                }
            }
        }
        activity = null;
        if (activity instanceof 1hK) {
            activity2 = activity;
        }
        1hK r2 = (1hK) activity2;
        if (r2 == null || !ijA.isQuickChat() || !C1802Inx.LIZ.LIZIZ()) {
            ChatRoomActivity.LIZIZ.LIZ(ijA);
            return true;
        }
        presentChatBottomSheet(r2, ijA);
        return true;
    }

    public final void storeFollowStatus(FollowStatus followStatus) {
        M12.LIZ(followStatus);
        C1499Ij4 ij4 = C1499Ij4.LIZ;
        Keva LIZ = C1499Ij4.LIZ.LIZ();
        long currentTimeMillis = System.currentTimeMillis();
        M12.LIZ(followStatus, LIZ);
        if (followStatus.followStatus == 1 || followStatus.followStatus == 4) {
            String str = followStatus.userId;
            n.LIZIZ(str, "");
            if (!LIZ.contains("key_single_follow_status".concat(String.valueOf(str)))) {
                LIZ.storeBoolean("key_single_follow_status".concat(String.valueOf(str)), true);
            }
        } else if (followStatus.followStatus == 2) {
            String str2 = followStatus.userId;
            n.LIZIZ(str2, "");
            ij4.LIZ(str2, LIZ, currentTimeMillis);
        }
    }

    public final void processMessagingDeepLink(Fragment fragment) {
        int i;
        int i2;
        String str;
        Long l;
        Integer num;
        Long l2;
        SessionListNavArg sessionListNavArg;
        M12.LIZ(fragment);
        M12.LIZ(fragment);
        Bundle arguments = fragment.getArguments();
        String str2 = null;
        if (arguments == null) {
            sessionListNavArg = null;
        } else {
            n.LIZIZ(arguments, "");
            String string = arguments.getString("enter_from");
            String string2 = arguments.getString("enter_method");
            Integer valueOf = Integer.valueOf(arguments.getInt("message_cnt"));
            String string3 = arguments.getString("notice_type");
            String string4 = arguments.getString("im_group_invite_id");
            String string5 = arguments.getString("conversation_id");
            String string6 = arguments.getString("is_member_request", "0");
            n.LIZIZ(string6, "");
            Integer LJ = 2tE.LJ(string6);
            int i3 = 0;
            if (LJ != null) {
                i = LJ.intValue();
            } else {
                i = 0;
            }
            Integer valueOf2 = Integer.valueOf(i);
            String string7 = arguments.getString("chat_type", "0");
            n.LIZIZ(string7, "");
            Integer LJ2 = 2tE.LJ(string7);
            if (LJ2 != null) {
                i2 = LJ2.intValue();
            } else {
                i2 = 0;
            }
            Integer valueOf3 = Integer.valueOf(i2);
            String string8 = arguments.getString("message_preview_enabled", "0");
            n.LIZIZ(string8, "");
            Integer LJ3 = 2tE.LJ(string8);
            if (LJ3 != null) {
                i3 = LJ3.intValue();
            }
            Integer valueOf4 = Integer.valueOf(i3);
            String string9 = arguments.getString("reply_to_message_content");
            if (string9 != null) {
                str = Uri.decode(string9);
            } else {
                str = null;
            }
            String string10 = arguments.getString("reply_to_message_server_id");
            if (string10 != null) {
                l = 2tE.LJI(string10);
            } else {
                l = null;
            }
            String string11 = arguments.getString("reply_to_message_type");
            if (string11 != null) {
                num = 2tE.LJ(string11);
            } else {
                num = null;
            }
            String string12 = arguments.getString("reply_to_message_from_uid");
            if (string12 != null) {
                l2 = 2tE.LJI(string12);
            } else {
                l2 = null;
            }
            sessionListNavArg = new SessionListNavArg(string, string2, valueOf, string3, string4, string5, valueOf2, valueOf3, valueOf4, str, l, num, l2);
        }
        C0986Ian ian = new C0986Ian();
        1hK requireActivity = fragment.requireActivity();
        n.LIZIZ(requireActivity, "");
        ian.LIZ(requireActivity, sessionListNavArg);
        1hK requireActivity2 = fragment.requireActivity();
        n.LIZIZ(requireActivity2, "");
        B7i b7i = new B7i(requireActivity2);
        if (sessionListNavArg != null) {
            str2 = sessionListNavArg.getJumpedFromInviteId();
        }
        b7i.LIZ(str2);
    }

    public final IMUser getIMUserFromUid(String str, String str2) {
        return IBA.LIZ(str, str2);
    }

    public final void logImIconRedesignExperiment(String str, String str2) {
        M12.LIZ(str, str2);
        C0995Iaw.LIZ(str, str2, (LsD<? super String, ? super Map<String, String>, 2Pr>) 4qe.LIZ);
    }

    public final void storeShareIconClickedTimeStamp(String str, long j) {
        M12.LIZ(str);
        IV2.LIZ(str, j);
    }

    public final View getDmEntranceView(Context context, String str) {
        M12.LIZ(str);
        if (context == null) {
            return null;
        }
        return EwK.LIZ.LIZ(context, str);
    }

    public final List<IMUser> searchFollowIMUser(List<? extends IMUser> list, String str) {
        return Ls0.LIZLLL(IBA.LIZ.LIZ(list, str, false));
    }

    public final void openBaMessageSettingActivity(Context context, String str) {
        M12.LIZ(context, str);
        SmartRoute buildRoute = SmartRouter.buildRoute(context, "//setting/ba/message_setting");
        buildRoute.withParam("enter_from", str);
        buildRoute.open();
    }

    public final void showGroupChatGuideBubble(Context context, View view) {
        M12.LIZ(context, view);
        Keva repo = Keva.getRepo("im_session_group_repo");
        if (!repo.getBoolean("im_key_guide_show", false)) {
            view.post(new IMService$showGroupChatGuideBubble$1(context, view, repo));
        }
    }

    public final void enterChooseContact(Context context, Bundle bundle) {
        Activity activity;
        M12.LIZ(context);
        IUserService createIUserServicebyMonsterPlugin = BaseUserService.createIUserServicebyMonsterPlugin(false);
        n.LIZIZ(createIUserServicebyMonsterPlugin, "");
        if (!createIUserServicebyMonsterPlugin.isLogin()) {
            while (true) {
                activity = null;
                if (context != null) {
                    if (!(context instanceof Activity)) {
                        if (!(context instanceof ContextWrapper)) {
                            break;
                        }
                        context = ((ContextWrapper) context).getBaseContext();
                    } else {
                        activity = (Activity) context;
                        break;
                    }
                } else {
                    break;
                }
            }
            Lw4.LIZ(activity, "chat_list", "button");
            return;
        }
        RelationSelectActivity.LIZ.LIZ(context, bundle);
    }

    public final void enterCreateChatPage(Context context, Bundle bundle) {
        M12.LIZ(context, bundle);
        if (IZE.LIZ.LIZ()) {
            bundle.putSerializable("member_select_config", new 4tr((Collection) null, (Collection) null, (4uH) null, (String) null, 15, (2HN) null));
            3VC r1 = 3VC.LJ;
            r1.LIZ("notification_page");
            r1.LIZ();
        }
        enterChooseContact(context, bundle);
    }

    public final void onNewNoticeArrived(int i, Bundle bundle) {
        M12.LIZ(bundle);
        if (i == 1) {
            C0962IaP.LIZ.LIZ();
        } else if (i == 3) {
            C0962IaP.LIZ.LIZ();
        } else if (i == 4) {
            CqM.LIZ(new C1344IgZ());
        }
    }

    public final void shouldShowFeedDMEntrance(Aweme aweme, LsC<? super Boolean, 2Pr> lsC) {
        String str;
        M12.LIZ(aweme);
        IMService$shouldShowFeedDMEntrance$authorCallback$1 iMService$shouldShowFeedDMEntrance$authorCallback$1 = new IMService$shouldShowFeedDMEntrance$authorCallback$1(lsC);
        User author = aweme.getAuthor();
        String str2 = null;
        if (author != null) {
            str = author.getUid();
        } else {
            str = null;
        }
        User author2 = aweme.getAuthor();
        if (author2 != null) {
            str2 = author2.getSecUid();
        }
        IBA.LIZ(str, str2, (IA0) iMService$shouldShowFeedDMEntrance$authorCallback$1);
    }

    public final void updateFakeDoubleFollow(String str, boolean z) {
        if (str != null) {
            Keva LIZ = C1499Ij4.LIZ.LIZ();
            M12.LIZ(str, LIZ);
            if (LIZ.contains("key_fake_double_follow_time_stamp".concat(String.valueOf(str)))) {
                if (z) {
                    LIZ.erase("key_fake_double_follow_time_stamp".concat(String.valueOf(str)));
                }
            } else if (!z) {
                LIZ.storeLong("key_fake_double_follow_time_stamp".concat(String.valueOf(str)), System.currentTimeMillis());
            }
        }
    }

    public final void updateFollowRequestedStatus(String str, boolean z) {
        M12.LIZ(str);
        C1499Ij4 ij4 = C1499Ij4.LIZ;
        M12.LIZ(str);
        Keva LIZ = ij4.LIZ();
        if (!z) {
            LIZ.storeBoolean("key_follow_requested_status".concat(String.valueOf(str)), true);
        } else if (LIZ.contains("key_double_follow_time_stamp".concat(String.valueOf(str)))) {
            LIZ.erase("key_follow_requested_status".concat(String.valueOf(str)));
        } else {
            ij4.LIZ(str, LIZ, System.currentTimeMillis());
        }
    }

    public final String getEntranceButtonText(Context context, String str) {
        M12.LIZ(context);
        Keva LIZ = C1499Ij4.LIZ.LIZ();
        M12.LIZ(context, LIZ);
        String string = context.getResources().getString(2131826951);
        n.LIZIZ(string, "");
        if (str != null) {
            C1499Ij4 ij4 = C1499Ij4.LIZ;
            M12.LIZ(str, LIZ);
            if (LIZ.contains("key_single_follow_status".concat(String.valueOf(str)))) {
                ij4.LIZ(str, LIZ, System.currentTimeMillis());
                LIZ.erase("key_single_follow_status".concat(String.valueOf(str)));
            }
            if (!ij4.LIZ(str, LIZ)) {
                if (!C1357Igm.LIZ.LIZIZ()) {
                    return string;
                }
                String string2 = context.getResources().getString(((Number) 3Vc.LIZ.LIZ().getFirst()).intValue(), new Object[]{"👋"});
                n.LIZIZ(string2, "");
                return string2;
            }
        }
        String string3 = context.getResources().getString(2131826951);
        n.LIZIZ(string3, "");
        return string3;
    }

    public final void handleGroupInvite(Activity activity, String str) {
        M12.LIZ(activity, str);
        C1513IjI ijI = new C1513IjI(activity, str);
        if (!BGN.LIZ.LIZ() || ESC.LIZLLL()) {
            ijI.LIZ();
            return;
        }
        String obj = 3Mn.LIZIZ().toString();
        C1510IjF ijF = new C1510IjF(ijI, obj);
        M12.LIZ(obj, ijF);
        if (C1527IjW.LIZJ.get(obj) == null) {
            C1527IjW.LIZJ.put(obj, new CopyOnWriteArrayList());
        }
        CopyOnWriteArrayList copyOnWriteArrayList = C1527IjW.LIZJ.get(obj);
        if (copyOnWriteArrayList != null) {
            copyOnWriteArrayList.add(ijF);
        }
        if (n.LIZ(3Mp.LIZIZ(), obj) && C1527IjW.LIZ) {
            ijF.LIZ();
        }
    }

    public final void openSessionListActivity(Context context, Bundle bundle) {
        Class cls;
        M12.LIZ(context);
        IV2.LIZIZ.LIZ(System.currentTimeMillis());
        if (bundle != null && !bundle.containsKey("message_cnt")) {
            bundle.putInt("message_cnt", Erw.LIZ(new int[]{99}));
        }
        if (!EcI.LIZ.LIZIZ()) {
            if (IZ2.LIZ.LIZ()) {
                cls = SessionListFragmentV2.class;
            } else {
                cls = SessionListFragment.class;
            }
            FNZ.LIZ(FNZ.LIZ, context, cls, bundle);
        } else if (bundle != null) {
            SmartRoute buildRoute = SmartRouter.buildRoute(context, "//chat/center");
            buildRoute.withParam(bundle);
            buildRoute.open();
        } else {
            SmartRouter.buildRoute(context, "//chat/center").open();
        }
    }

    public final void trackVideoPlayClickDuration(String str, String str2) {
        M12.LIZ(str);
        Keva LIZ = IV2.LIZIZ.LIZ();
        M12.LIZ(LIZ);
        long j = LIZ.getLong("chat_video_play_performance", -1);
        LIZ.erase("chat_video_play_performance");
        long currentTimeMillis = System.currentTimeMillis() - j;
        if (j > 0 && currentTimeMillis > 0) {
            3UB r3 = 3UB.LIZ;
            M12.LIZ(str, r3);
            19Y r2 = new 19Y();
            r2.put("duration", String.valueOf(currentTimeMillis));
            r2.put("enter_method", str2);
            r2.put("enter_from", "chat");
            r2.put("chat_type", str);
            r3.invoke("chat_video_play_performance", r2);
        }
    }

    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r3v1, resolved type: X.Iap} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r3v4, resolved type: X.IiR} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r3v5, resolved type: X.Iap} */
    /* JADX DEBUG: Multi-variable search result rejected for TypeSearchVarInfo{r3v6, resolved type: X.Iap} */
    /* JADX WARNING: Multi-variable type inference failed */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void presentChatBottomSheet(X.1hK r6, X.C1505IjA r7) {
        /*
            r5 = this;
            X.M12.LIZ(r6, r7)
            X.M12.LIZ(r7)
            java.lang.String r2 = r7.getSessionId()
            r4 = 0
            if (r2 != 0) goto L_0x000e
            return
        L_0x000e:
            int r1 = r7.getChatType()
            r0 = 3
            if (r1 == r0) goto L_0x010c
            X.IiR r3 = new X.IiR
            java.lang.String r0 = r7.getUuid()
            r3.<init>(r0)
            com.ss.android.ugc.aweme.im.service.model.IMUser r0 = r7.getImUser()
            r3.setFromUser(r0)
            java.lang.String r0 = r7.getShareUserId()
            r3.setShareUserId(r0)
            java.io.Serializable r0 = r7.getChatExt()
            r3.setChatExt(r0)
            X.DRu r0 = r7.getImAdLog()
            r3.setImAdLog(r0)
            boolean r0 = r7.isTCM()
            r3.setTCM(r0)
        L_0x0041:
            r3.setConversationId(r2)
            int r0 = r7.getEnterFrom()
            r3.setEnterFrom(r0)
            java.lang.String r0 = r7.getEnterFromForMob()
            java.lang.String r1 = ""
            if (r0 != 0) goto L_0x0054
            r0 = r1
        L_0x0054:
            r3.setEnterFromForMob(r0)
            int r0 = r7.getChatType()
            r3.setChatType(r0)
            int r0 = r7.getUnreadCount()
            r3.setUnreadCount(r0)
            java.lang.String r0 = r7.getEnterMethodForMob()
            if (r0 != 0) goto L_0x006c
            r0 = r1
        L_0x006c:
            r3.setEnterMethod(r0)
            java.lang.String r0 = r7.getAuthorId()
            r3.setAuthorId(r0)
            java.lang.String r0 = r7.getGroupId()
            if (r0 != 0) goto L_0x0109
        L_0x007c:
            r3.setGroupId(r1)
            X.Ifj r1 = X.C1292Ifj.LIZ
            X.M12.LIZ(r6, r3)
            X.Inx r0 = X.C1802Inx.LIZ
            boolean r0 = r0.LIZIZ()
            if (r0 == 0) goto L_0x00c6
            java.lang.String r2 = r1.LIZ(r3)
            X.0AA r0 = r6.getSupportFragmentManager()
            androidx.fragment.app.Fragment r1 = r0.LIZ(r2)
            boolean r0 = r1 instanceof com.ss.android.ugc.aweme.im.sdk.chat.feature.quickinteraction.fragment.BaseQuickChatRoomFragment
            if (r0 != 0) goto L_0x0107
        L_0x009c:
            com.ss.android.ugc.aweme.im.sdk.chat.feature.quickinteraction.fragment.BaseQuickChatRoomFragment r4 = (com.ss.android.ugc.aweme.im.sdk.chat.feature.quickinteraction.fragment.BaseQuickChatRoomFragment) r4
            if (r4 == 0) goto L_0x00c7
        L_0x00a0:
            X.3YB r1 = new X.3YB
            r1.<init>()
            r1.LIZ(r4)
            r0 = 4
            r1.LIZ(r0)
            r0 = 48
            r1.LIZLLL(r0)
            r0 = 0
            r1.LIZIZ(r0)
            com.ss.android.ugc.aweme.im.sdk.chat.feature.quickinteraction.bottomsheet.IgnoreRecyclerAndPagerBottomSheetBehaviour r0 = new com.ss.android.ugc.aweme.im.sdk.chat.feature.quickinteraction.bottomsheet.IgnoreRecyclerAndPagerBottomSheetBehaviour
            r0.<init>()
            r1.LIZ(r0)
            com.bytedance.tux.sheet.sheet.TuxSheet r1 = r1.LIZ
            X.0AA r0 = r6.getSupportFragmentManager()
            r1.show(r0, r2)
        L_0x00c6:
            return
        L_0x00c7:
            boolean r0 = r3 instanceof X.C0988Iap
            java.lang.String r1 = "key_session_info"
            if (r0 == 0) goto L_0x00e0
            X.Iap r3 = (X.C0988Iap) r3
            com.ss.android.ugc.aweme.im.sdk.chat.feature.quickinteraction.fragment.GroupQuickChatRoomFragment r4 = new com.ss.android.ugc.aweme.im.sdk.chat.feature.quickinteraction.fragment.GroupQuickChatRoomFragment
            r4.<init>()
            android.os.Bundle r0 = new android.os.Bundle
            r0.<init>()
            r0.putSerializable(r1, r3)
            r4.setArguments(r0)
            goto L_0x00a0
        L_0x00e0:
            boolean r0 = r3 instanceof X.C1460IiR
            if (r0 == 0) goto L_0x00f7
            X.IiR r3 = (X.C1460IiR) r3
            com.ss.android.ugc.aweme.im.sdk.chat.feature.quickinteraction.fragment.SingleQuickChatRoomFragment r4 = new com.ss.android.ugc.aweme.im.sdk.chat.feature.quickinteraction.fragment.SingleQuickChatRoomFragment
            r4.<init>()
            android.os.Bundle r0 = new android.os.Bundle
            r0.<init>()
            r0.putSerializable(r1, r3)
            r4.setArguments(r0)
            goto L_0x00a0
        L_0x00f7:
            java.lang.String r1 = java.lang.String.valueOf(r3)
            java.lang.String r0 = "quick_chat_sheet: session info has wrong type "
            java.lang.String r1 = r0.concat(r1)
            java.lang.String r0 = "quick_chat_sheet"
            X.3Q4.LIZLLL(r0, r1)
            goto L_0x00c6
        L_0x0107:
            r4 = r1
            goto L_0x009c
        L_0x0109:
            r1 = r0
            goto L_0x007c
        L_0x010c:
            X.Iap r3 = new X.Iap
            java.lang.String r0 = r7.getUuid()
            r3.<init>(r0)
            goto L_0x0041
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService.presentChatBottomSheet(X.1hK, X.IjA):void");
    }

    public final void setHighlightText(TextView textView, String str, String str2) {
        M12.LIZ(textView, str2);
        3sB.LIZ(3sB.LIZ, textView, str, str2);
    }

    public final void setInnerPushSwitch(String str, int i, boolean z) {
        M12.LIZ(str);
        C1173Ido.LIZIZ.LIZ(str, i, z);
    }

    public final void saveChatUserSetting(int i, int i2, int i3) {
        C0686IQj LIZ = C0686IQj.LIZ();
        n.LIZIZ(LIZ, "");
        LIZ.LIZ(new 3qa(i, i2, i3));
    }

    /*  JADX ERROR: JadxRuntimeException in pass: CodeShrinkVisitor
        jadx.core.utils.exceptions.JadxRuntimeException: Don't wrap MOVE or CONST insns: 0x000d: MOVE  (r5v0 X.B6u) = (r10v0 X.B6u)
        	at jadx.core.dex.instructions.args.InsnArg.wrapArg(InsnArg.java:164)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.assignInline(CodeShrinkVisitor.java:133)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.checkInline(CodeShrinkVisitor.java:118)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.shrinkBlock(CodeShrinkVisitor.java:65)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.shrinkMethod(CodeShrinkVisitor.java:43)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.visit(CodeShrinkVisitor.java:35)
        */
    public final android.view.View getIMSnackbarView(android.content.Context r9, X.B6u r10, X.Ls2<X.2Pr> r11) {
        /*
            r8 = this;
            r7 = r11
            X.M12.LIZ(r7)
            X.4qc r2 = X.4qc.LIZ
            X.M12.LIZ(r7)
            r1 = 0
            r4 = r9
            if (r4 == 0) goto L_0x0010
            r5 = r10
            if (r5 != 0) goto L_0x0011
        L_0x0010:
            return r1
        L_0x0011:
            java.lang.String r3 = X.B6v.LIZ(r4, r5)
            int r0 = r3.length()
            if (r0 != 0) goto L_0x001c
            return r1
        L_0x001c:
            r6 = 0
            android.view.View r0 = r2.LIZ(r3, r4, r5, r6, r7)
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService.getIMSnackbarView(android.content.Context, X.B6u, X.Ls2):android.view.View");
    }

    /*  JADX ERROR: JadxRuntimeException in pass: CodeShrinkVisitor
        jadx.core.utils.exceptions.JadxRuntimeException: Don't wrap MOVE or CONST insns: 0x0007: MOVE  (r10v0 X.B6u) = (r16v0 X.B6u)
        	at jadx.core.dex.instructions.args.InsnArg.wrapArg(InsnArg.java:164)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.assignInline(CodeShrinkVisitor.java:133)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.checkInline(CodeShrinkVisitor.java:118)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.shrinkBlock(CodeShrinkVisitor.java:65)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.shrinkMethod(CodeShrinkVisitor.java:43)
        	at jadx.core.dex.visitors.shrink.CodeShrinkVisitor.visit(CodeShrinkVisitor.java:35)
        */
    /* JADX WARNING: Removed duplicated region for block: B:17:0x00b6  */
    /* JADX WARNING: Removed duplicated region for block: B:33:0x0021 A[SYNTHETIC] */
    public final void showIMSnackbar(android.content.Context r14, android.view.View r15, X.B6u r16) {
        /*
            r13 = this;
            X.4qc r7 = X.4qc.LIZ
            r9 = r14
            if (r9 == 0) goto L_0x000b
            if (r15 == 0) goto L_0x000b
            r10 = r16
            if (r10 != 0) goto L_0x000c
        L_0x000b:
            return
        L_0x000c:
            java.lang.String r8 = X.B6v.LIZ(r9, r10)
            int r1 = r8.length()
            r0 = 1
            r4 = 0
            if (r1 != 0) goto L_0x0019
            goto L_0x000b
        L_0x0019:
            java.lang.String r3 = ""
            r2 = 0
            r1 = r2
        L_0x001d:
            boolean r0 = r15 instanceof X.1gt
            if (r0 == 0) goto L_0x00b6
            android.view.ViewGroup r15 = (android.view.ViewGroup) r15
        L_0x0023:
            if (r15 == 0) goto L_0x00d9
            android.content.Context r0 = r15.getContext()
            android.view.LayoutInflater r6 = android.view.LayoutInflater.from(r0)
            android.content.Context r1 = r15.getContext()
            int[] r0 = com.google.android.material.snackbar.Snackbar.LJIIIZ
            android.content.res.TypedArray r5 = r1.obtainStyledAttributes(r0)
            r1 = -1
            int r0 = r5.getResourceId(r4, r1)
            r5.recycle()
            if (r0 == r1) goto L_0x00b2
            r0 = 2131560642(0x7f0d08c2, float:1.8746662E38)
        L_0x0044:
            android.view.View r0 = X.0HH.LIZ(r6, r0, r15, r4)
            X.Oei r0 = (X.Oei) r0
            com.google.android.material.snackbar.Snackbar r5 = new com.google.android.material.snackbar.Snackbar
            r5.<init>(r15, r0, r0)
            com.google.android.material.snackbar.BaseTransientBottomBar$d r0 = r5.LJ
            android.view.View r0 = r0.getChildAt(r4)
            X.Oei r0 = (X.Oei) r0
            android.widget.TextView r0 = r0.getMessageView()
            r0.setText(r3)
            r0 = -2
            r5.LJI = r0
            kotlin.h.b.n.LIZIZ(r5, r3)
            com.google.android.material.snackbar.BaseTransientBottomBar$d r11 = r5.LJ
            java.lang.String r0 = "null cannot be cast to non-null type com.google.android.material.snackbar.Snackbar.SnackbarLayout"
            java.util.Objects.requireNonNull(r11, r0)
            X.3K4 r11 = (X.3K4) r11
            r11.setPadding(r4, r4, r4, r4)
            r0 = 2131370459(0x7f0a21db, float:1.8360925E38)
            android.view.View r1 = r11.findViewById(r0)
            android.widget.TextView r1 = (android.widget.TextView) r1
            kotlin.h.b.n.LIZIZ(r1, r3)
            r0 = 4
            r1.setVisibility(r0)
            X.3Gy r12 = new X.3Gy
            r12.<init>(r5)
            r7.LIZ(r8, r9, r10, r11, r12)
            X.DB2 r0 = X.DCr.LIZIZ
            X.Cv9 r1 = X.DAj.LIZ(r0)
            X.3Gx r0 = new X.3Gx
            r0.<init>(r5, r2)
            r4 = 3
            X.DAe.LIZ(r1, r2, r0, r4)
            X.DB2 r3 = X.DCr.LIZIZ
            X.DCl r1 = kotlinx.coroutines.CoroutineExceptionHandler.LIZLLL
            X.3HB r0 = new X.3HB
            r0.<init>(r1)
            X.D8s r0 = r3.plus(r0)
            X.Cv9 r1 = X.DAj.LIZ(r0)
            X.3Gz r0 = new X.3Gz
            r0.<init>(r5, r2)
            X.DAe.LIZ(r1, r2, r0, r4)
            goto L_0x000b
        L_0x00b2:
            r0 = 2131559484(0x7f0d043c, float:1.8744313E38)
            goto L_0x0044
        L_0x00b6:
            boolean r0 = r15 instanceof android.widget.FrameLayout
            if (r0 == 0) goto L_0x00ca
            int r1 = r15.getId()
            r0 = 16908290(0x1020002, float:2.3877235E-38)
            if (r1 != r0) goto L_0x00c7
            android.view.ViewGroup r15 = (android.view.ViewGroup) r15
            goto L_0x0023
        L_0x00c7:
            r1 = r15
            android.view.ViewGroup r1 = (android.view.ViewGroup) r1
        L_0x00ca:
            android.view.ViewParent r15 = r15.getParent()
            boolean r0 = r15 instanceof android.view.View
            if (r0 == 0) goto L_0x00d6
            android.view.View r15 = (android.view.View) r15
            if (r15 != 0) goto L_0x001d
        L_0x00d6:
            r15 = r1
            goto L_0x0023
        L_0x00d9:
            java.lang.IllegalArgumentException r1 = new java.lang.IllegalArgumentException
            java.lang.String r0 = "No suitable parent found from the given view. Please provide a valid view."
            r1.<init>(r0)
            throw r1
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService.showIMSnackbar(android.content.Context, android.view.View, X.B6u):void");
    }

    /* JADX WARNING: Code restructure failed: missing block: B:3:0x0010, code lost:
        r12 = X.C0686IQj.LIZ();
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void tryShowingChatPrivacyPanel(java.lang.String r17, X.0AA r18, X.C1528IjX r19) {
        /*
            r16 = this;
            r15 = r18
            r13 = r17
            X.M12.LIZ(r13, r15)
            java.lang.String r0 = "notification_page"
            boolean r0 = kotlin.h.b.n.LIZ(r13, r0)
            if (r0 == 0) goto L_0x0010
            return
        L_0x0010:
            X.IQj r12 = X.C0686IQj.LIZ()
            X.3qa r11 = r12.LJIIJJI()
            if (r11 == 0) goto L_0x00db
            int r0 = r11.getChatSettingsPanel()
            java.lang.Integer r10 = java.lang.Integer.valueOf(r0)
            int r1 = r10.intValue()
            r0 = 0
            r2 = 1
            if (r1 != r2) goto L_0x00db
            r0 = 1
            r4 = 0
            if (r0 == 0) goto L_0x00db
            if (r10 == 0) goto L_0x00db
            r10.intValue()
            android.content.SharedPreferences r3 = r12.LIZ
            r0 = 0
            java.lang.String r5 = "chat_user_setting_last_open"
            long r8 = r3.getLong(r5, r0)
            long r6 = java.lang.System.currentTimeMillis()
            r0 = 86400000(0x5265c00, double:4.2687272E-316)
            long r6 = r6 - r0
            int r0 = (r8 > r6 ? 1 : (r8 == r6 ? 0 : -1))
            if (r0 >= 0) goto L_0x00db
            int r1 = r12.LJIIL()
            r0 = 3
            if (r1 >= r0) goto L_0x00db
            r10.intValue()
            long r0 = java.lang.System.currentTimeMillis()
            android.content.SharedPreferences r3 = r12.LIZ
            android.content.SharedPreferences$Editor r3 = r3.edit()
            android.content.SharedPreferences$Editor r0 = r3.putLong(r5, r0)
            r0.commit()
            int r3 = r12.LJIIL()
            int r3 = r3 + r2
            android.content.SharedPreferences r0 = r12.LIZ
            android.content.SharedPreferences$Editor r1 = r0.edit()
            java.lang.String r0 = "chat_user_setting_open_count"
            android.content.SharedPreferences$Editor r0 = r1.putInt(r0, r3)
            r0.commit()
            X.2sG r10 = new X.2sG
            r10.<init>()
            r10.element = r4
            X.3YB r3 = new X.3YB
            r3.<init>()
            com.ss.android.ugc.aweme.im.sdk.privacy.ui.fragment.MessagingPrivacyFragment r9 = new com.ss.android.ugc.aweme.im.sdk.privacy.ui.fragment.MessagingPrivacyFragment
            r9.<init>()
            android.os.Bundle r4 = new android.os.Bundle
            r4.<init>()
            int r1 = r11.getChatSet()
            java.lang.String r0 = "chat_set_extra"
            r4.putInt(r0, r1)
            java.lang.String r0 = "enter_from_extra"
            r4.putString(r0, r13)
            int r1 = r11.getChatUserType()
            java.lang.String r0 = "user_type_extra"
            r4.putInt(r0, r1)
            int r1 = r12.LJIIL()
            java.lang.String r0 = "open_count_extra"
            r4.putInt(r0, r1)
            r9.setArguments(r4)
            com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService$tryShowingChatPrivacyPanel$$inlined$run$lambda$1 r8 = new com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService$tryShowingChatPrivacyPanel$$inlined$run$lambda$1
            r14 = r19
            r8.<init>(r9, r10, r11, r12, r13, r14, r15)
            r9.LIZ = r8
            r3.LIZ(r9)
            r3.LIZ(r2)
            com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService$tryShowingChatPrivacyPanel$$inlined$run$lambda$2 r0 = new com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService$tryShowingChatPrivacyPanel$$inlined$run$lambda$2
            r4 = r0
            r5 = r11
            r6 = r12
            r7 = r13
            r8 = r14
            r9 = r15
            r4.<init>(r5, r6, r7, r8, r9)
            r3.LIZ(r0)
            com.bytedance.tux.sheet.sheet.TuxSheet r0 = r3.LIZ
            r10.element = r0
            java.lang.Object r1 = r10.element
            androidx.fragment.app.DialogFragment r1 = (androidx.fragment.app.DialogFragment) r1
            java.lang.String r0 = "Chat Privacy Panel"
            r1.show(r15, r0)
        L_0x00db:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService.tryShowingChatPrivacyPanel(java.lang.String, X.0AA, X.IjX):void");
    }

    public final void initialize(Application application, C1955IqQ iqQ, C1194Ie9 ie9) {
        boolean z;
        long j;
        9JE LIZ;
        M12.LIZ(application, ie9);
        inst = this;
        if (iqQ != null) {
            String str = iqQ.LJ;
            n.LIZIZ(str, "");
            C1546Ijp.LIZIZ = str;
            String str2 = iqQ.LIZIZ;
            n.LIZIZ(str2, "");
            C1546Ijp.LIZ = str2;
            String str3 = iqQ.LIZJ;
            n.LIZIZ(str3, "");
            C1546Ijp.LIZJ = str3;
        }
        C1103Icg icg = C1103Icg.LJ;
        M12.LIZ(application, ie9);
        if (!C1103Icg.LIZLLL) {
            C1103Icg.LIZLLL = true;
            3Q4.LIZIZ("AwemeImManager", "init");
            C1103Icg.LIZJ = iqQ;
            C1103Icg.LIZIZ = ie9;
            if (!EventBus.LIZ().LIZ(icg)) {
                EventBus.LIZ(EventBus.LIZ(), icg);
            }
            4nL r10 = new 4nL();
            if (8li.LIZ.LIZ() || !8lq.LIZIZ.LIZ() || (C1549Ijs.LIZ.LIZ() & 1) != 1) {
                z = false;
            } else {
                z = true;
            }
            if (z) {
                j = 5000;
            } else if (!8li.LIZ.LIZ() ? !8lq.LIZIZ.LIZ() || (C1549Ijs.LIZ.LIZ() & 4) != 4 : !9Eh.LIZLLL.LIZIZ() || !9Gf.LIZIZ.LIZ()) {
                j = 10;
            } else {
                j = 8000;
            }
            r10.element = j;
            if (((Boolean) MK9.LJFF.getValue()).booleanValue() && (LIZ = 9JF.LIZ.LIZ("homepage_message_level")) != null) {
                int LIZIZ = LIZ.LIZIZ();
                if (LIZIZ == 0) {
                    r10.element = 150000;
                } else if (LIZIZ == 1) {
                    r10.element = 8000;
                } else if (LIZIZ == 2) {
                    r10.element = 5000;
                } else if (LIZIZ == 3) {
                    r10.element = 10;
                }
            }
            if (9H6.LJIIIZ.LIZJ() && r10.element >= 5000) {
                r10.element -= 1000;
            }
            3Q4.LIZIZ("AwemeImManager", "start sdk delay time:" + r10.element);
            DAe.LIZ(C1103Icg.LIZ, (D8s) null, new FEh(r10, (4r1) null), 3);
        }
    }

    public final String convertSearchKeyword(String str, String str2, String str3, String str4) {
        String LIZ = Frf.LIZ(str, str2, str3, str4);
        n.LIZIZ(LIZ, "");
        return LIZ;
    }

    public final void shareSingleMsg(Context context, IMContact iMContact, SharePackage sharePackage, 3g6<Boolean> r11) {
        SharePackage sharePackage2 = sharePackage;
        if (sharePackage2 != null) {
            if (TextUtils.equals(sharePackage2.LJIIIZ, "web")) {
                C2177Iu0.LIZ((List<IMContact>) Collections.singletonList(iMContact), (String) null, sharePackage2, (BaseContent) null, C1130Id7.LIZ(), (String) null, (C2190IuD) null);
            } else {
                C2177Iu0.LIZ((List<IMContact>) Collections.singletonList(iMContact), (String) null, sharePackage2, (BaseContent) null, (String) null, (String) null, (C2190IuD) null);
            }
            if (r11 != null) {
                r11.LIZ(true);
            }
        }
    }

    public final void showFeedDMFragment(0AA r5, Aweme aweme, String str, LsC<? super CharSequence, 2Pr> lsC) {
        M12.LIZ(r5, aweme, str);
        DetailFeedKeyboardDialogFragment LIZ = DetailFeedKeyboardDialogFragment.LIZLLL.LIZ(r5);
        Bundle bundle = new Bundle();
        bundle.putBoolean("showEmojiTab", false);
        bundle.putSerializable("video", aweme);
        bundle.putString("enterFrom", "reply_im_icon");
        LIZ.setArguments(bundle);
        LIZ.LIZ((C1596Ikd) new IMService$showFeedDMFragment$2(LIZ, aweme, str, lsC));
        LIZ.LIZ(r5);
    }

    /* JADX WARNING: Code restructure failed: missing block: B:18:0x0064, code lost:
        if (r0 == null) goto L_0x0071;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void showReplyFragment(android.view.View r7, X.0AA r8, android.os.Bundle r9, java.lang.String r10) {
        /*
            r6 = this;
            r5 = 798(0x31e, float:1.118E-42)
            com.bytedance.frameworks.apm.trace.MethodCollector.i(r5)
            if (r7 == 0) goto L_0x0009
            if (r8 != 0) goto L_0x000d
        L_0x0009:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r5)
            return
        L_0x000d:
            r4 = 2131365829(0x7f0a0fc5, float:1.8351534E38)
            android.view.View r0 = r7.findViewById(r4)
            java.lang.String r3 = "reply_fragment_tag"
            androidx.fragment.app.Fragment r2 = r8.LIZ(r3)
            if (r2 == 0) goto L_0x0064
            if (r0 == 0) goto L_0x0067
            com.ss.android.ugc.aweme.im.sdk.chat.feature.reply.feature.feed.DetailFeedReplyMessageFragment r2 = (com.ss.android.ugc.aweme.im.sdk.chat.feature.reply.feature.feed.DetailFeedReplyMessageFragment) r2
        L_0x0020:
            if (r2 == 0) goto L_0x0009
            r2.LJI = r10
            java.lang.String r1 = r2.LJ
            if (r1 == 0) goto L_0x009d
            java.lang.String r0 = r2.LJI
            if (r0 == 0) goto L_0x0099
            java.lang.Long r0 = X.2tE.LJI(r0)
            if (r0 == 0) goto L_0x0099
            long r3 = r0.longValue()
            com.ss.android.ugc.aweme.im.sdk.chat.viewmodel.ChatViewModel r2 = r2.LIZ()
            X.M12.LIZ(r1)
            X.IjN r0 = new X.IjN
            r0.<init>(r2, r1, r3)
            X.PgV r1 = X.PgV.LIZ(r0)
            X.PlG r0 = r2.LJI
            X.PgV r1 = r1.LIZIZ(r0)
            X.PlG r0 = r2.LJII
            X.PgV r1 = r1.LIZ(r0)
            X.IjH r0 = new X.IjH
            r0.<init>(r2)
            X.2cN r1 = r1.LIZIZ(r0)
            X.Mjy r0 = r2.LIZJ
            r0.LIZ(r1)
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r5)
            return
        L_0x0064:
            if (r0 != 0) goto L_0x0082
            goto L_0x0071
        L_0x0067:
            X.0AP r0 = r8.LIZ()
            r0.LIZ(r2)
            r0.LIZJ()
        L_0x0071:
            android.widget.LinearLayout r1 = new android.widget.LinearLayout
            android.content.Context r0 = r7.getContext()
            r1.<init>(r0)
            r1.setId(r4)
            android.view.ViewGroup r7 = (android.view.ViewGroup) r7
            r7.addView(r1)
        L_0x0082:
            com.ss.android.ugc.aweme.im.sdk.chat.feature.reply.feature.feed.DetailFeedReplyMessageFragment r2 = new com.ss.android.ugc.aweme.im.sdk.chat.feature.reply.feature.feed.DetailFeedReplyMessageFragment
            r2.<init>()
            if (r9 == 0) goto L_0x008c
            r2.setArguments(r9)
        L_0x008c:
            X.0AP r0 = r8.LIZ()
            r0.LIZ(r4, r2, r3)
            r0.LIZJ()
            com.ss.android.ugc.aweme.im.sdk.chat.feature.reply.feature.feed.DetailFeedReplyMessageFragment r2 = (com.ss.android.ugc.aweme.im.sdk.chat.feature.reply.feature.feed.DetailFeedReplyMessageFragment) r2
            goto L_0x0020
        L_0x0099:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r5)
            return
        L_0x009d:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r5)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService.showReplyFragment(android.view.View, X.0AA, android.os.Bundle, java.lang.String):void");
    }

    public final void showDmInputViewDialogFragment(0AA r4, String str, Aweme aweme, String str2, C1530IjZ ijZ) {
        M12.LIZ(r4, str, aweme, str2, ijZ);
        M12.LIZ(r4, str, aweme, str2, ijZ);
        StoryDmDialogFragment storyDmDialogFragment = new StoryDmDialogFragment();
        Bundle bundle = new Bundle();
        bundle.putString("enter_from", str);
        bundle.putSerializable("bindAweme", aweme);
        bundle.putString("bindInputText", str2);
        storyDmDialogFragment.setArguments(bundle);
        storyDmDialogFragment.LIZ = ijZ;
        try {
            storyDmDialogFragment.show(r4, "StoryDmDialogFragment");
        } catch (IllegalStateException e) {
            0HH.LIZ(e);
        }
    }

    public final void startSelectChatMsg(Context context, String str, IMUser iMUser, int i, String str2) {
        Integer num;
        int i2;
        if (i == 1) {
            if (TextUtils.isEmpty(str2)) {
                C1426Iht.LIZ(str);
            }
            if (!TextUtils.isEmpty(str)) {
                HashMap<String, Integer> hashMap = C1426Iht.LIZIZ;
                if (hashMap != null) {
                    num = hashMap.get(str);
                } else {
                    num = null;
                }
                C1504Ij9 ij9 = ChatRoomActivity.LIZIZ;
                C1506IjB LIZ = C1505IjA.Companion.LIZ(context, iMUser);
                if (num != null) {
                    i2 = num.intValue();
                } else {
                    i2 = 0;
                }
                LIZ.LIZIZ(i2);
                LIZ.LIZ(str);
                LIZ.LIZ.setSelectMsgType(i);
                LIZ.LIZ.setEnterSelectChatMsgActivity(true);
                ij9.LIZ(LIZ.LIZ);
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:5:0x0045, code lost:
        if (kotlin.h.b.n.LIZ(r1, "notification_page") != false) goto L_0x0047;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final void sendSayhiEmoji(android.content.Context r13, java.lang.String r14, java.lang.String r15, boolean r16, java.util.Map<java.lang.String, java.lang.String> r17, boolean r18, X.Ls2<X.2Pr> r19) {
        /*
            r12 = this;
            r5 = r14
            X.M12.LIZ(r5)
            X.IjL r0 = X.C1519IjO.LIZ
            X.IkK r4 = r0.LIZ()
            r4.LIZ((java.lang.String) r5)
            com.ss.android.ugc.aweme.im.sdk.chat.data.model.TextContent$Companion r3 = com.ss.android.ugc.aweme.im.sdk.chat.data.model.TextContent.Companion
            java.lang.String r2 = "👋👋👋"
            r1 = 0
            r0 = 2
            com.ss.android.ugc.aweme.im.sdk.chat.data.model.TextContent r0 = com.ss.android.ugc.aweme.im.sdk.chat.data.model.TextContent.Companion.obtain$default(r3, r2, r1, r0, r1)
            r4.LIZ((X.C1688Im7) r0)
            r3 = r17
            r4.LIZ((java.util.Map<java.lang.String, java.lang.String>) r3)
            com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService$sendSayhiEmoji$1 r6 = new com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService$sendSayhiEmoji$1
            r11 = r18
            r10 = r19
            r7 = r13
            r8 = r15
            r9 = r16
            r6.<init>(r7, r8, r9, r10, r11)
            r4.LIZ((X.C3792Jex) r6)
            X.Ij4 r0 = X.C1499Ij4.LIZ
            com.bytedance.keva.Keva r2 = r0.LIZ()
            if (r8 != 0) goto L_0x0047
            if (r3 == 0) goto L_0x003f
            java.lang.String r0 = "enter_from"
            java.lang.Object r1 = r3.get(r0)
        L_0x003f:
            java.lang.String r0 = "notification_page"
            boolean r0 = kotlin.h.b.n.LIZ(r1, r0)
            if (r0 == 0) goto L_0x004c
        L_0x0047:
            X.Ij4 r0 = X.C1499Ij4.LIZ
            r0.LIZIZ(r5, r2)
        L_0x004c:
            X.M12.LIZ(r5, r2)
            java.lang.String r0 = java.lang.String.valueOf(r5)
            java.lang.String r1 = "key_has_chat_history"
            java.lang.String r0 = r1.concat(r0)
            boolean r0 = r2.contains(r0)
            if (r0 != 0) goto L_0x006b
            java.lang.String r0 = java.lang.String.valueOf(r5)
            java.lang.String r1 = r1.concat(r0)
            r0 = 1
            r2.storeBoolean(r1, r0)
        L_0x006b:
            X.Euf r0 = X.Euf.LIZ
            X.E0A r0 = r0.LIZIZ()
            X.2ce r0 = r0.LIZ()
            X.Dqs r4 = new X.Dqs
            r6 = 2
            r7 = 0
            r8 = 0
            r9 = 12
            r10 = 0
            r4.<init>(r5, r6, r7, r8, r9, r10)
            r0.postValue(r4)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService.sendSayhiEmoji(android.content.Context, java.lang.String, java.lang.String, boolean, java.util.Map, boolean, X.Ls2):void");
    }
}
