导航菜单

页面标题

页面副标题

Bhakti v5.4.0 - MasterActivity.java 源代码

正在查看: Bhakti v5.4.0 应用的 MasterActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.vlv.aravali.master.ui;

import Ai.EN.gYVEuEOn;
import Qn.AbstractC0210b;
import Vj.AbstractC0493m;
import Vj.C0513n;
import Vj.J4;
import Zn.C0896y0;
import android.app.NotificationManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.ShortcutManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.media.AudioManager;
import android.net.Uri;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.PowerManager;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.Toast;
import androidx.appcompat.widget.AppCompatImageView;
import androidx.compose.ui.platform.ComposeView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.graphics.drawable.IconCompat;
import androidx.credentials.playservices.controllers.BeginSignIn.CredentialProviderBeginSignInController$;
import androidx.fragment.app.Fragment;
import androidx.navigation.fragment.NavHostFragment;
import bj.C0910a;
import cm.C1110m;
import com.airbnb.lottie.LottieAnimationView;
import com.google.android.gms.tasks.Task;
import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.navigation.NavigationBarItemView;
import com.google.android.material.navigation.NavigationBarMenuView;
import com.google.android.material.navigation.NavigationBarView;
import com.vlv.aravali.KukuFMApplication;
import com.vlv.aravali.bottomRating.data.RatingFlow;
import com.vlv.aravali.coachMarks.CoachMarkEntity;
import com.vlv.aravali.coins.data.responses.CoinRewardAd;
import com.vlv.aravali.coins.data.responses.CoinSilentNotifData;
import com.vlv.aravali.coins.ui.fragments.StoreViewPagerFragment;
import com.vlv.aravali.coins.ui.fragments.UnlockEpisodeBottomSheet;
import com.vlv.aravali.common.models.BottomNavMenuItem;
import com.vlv.aravali.common.models.CUPart;
import com.vlv.aravali.common.models.CoinsRewardedResponse;
import com.vlv.aravali.common.models.ContentType;
import com.vlv.aravali.common.models.FreeTrialResponse;
import com.vlv.aravali.common.models.MlPopupData;
import com.vlv.aravali.common.models.PromoRewardedCoinsInfo;
import com.vlv.aravali.common.models.RatingResponse;
import com.vlv.aravali.common.models.ReminderResponse;
import com.vlv.aravali.common.models.Show;
import com.vlv.aravali.common.models.User;
import com.vlv.aravali.common.models.appConfigs.Config;
import com.vlv.aravali.common.models.coins.Pack;
import com.vlv.aravali.common.models.payments.PlanDetailItem;
import com.vlv.aravali.common.models.user.UserResponse;
import com.vlv.aravali.common.models.vip.Offer;
import com.vlv.aravali.commonFeatures.mobileAds.data.CoinRewardAdsResponse;
import com.vlv.aravali.gamification.model.LeagueLeaderboardResponse;
import com.vlv.aravali.home.data.Challenge;
import com.vlv.aravali.master.data.MasterConfig;
import com.vlv.aravali.mlPopup.MlPopupEvents$GetButtonClicked;
import com.vlv.aravali.model.Banner;
import com.vlv.aravali.model.EventData;
import com.vlv.aravali.model.genericPopup.GenericPopupResponse;
import com.vlv.aravali.model.response.PartnershipData;
import com.vlv.aravali.moreLikeThis.data.MoreLikeThisData;
import com.vlv.aravali.navratriSpecial.NavratriSpecialDialogFragment;
import com.vlv.aravali.network.data.mDsu.rpdvnbM;
import com.vlv.aravali.network.rx.RxEvent;
import com.vlv.aravali.network.rx.RxEvent$ActivityResult;
import com.vlv.aravali.payments.common.data.SubscriptionMeta;
import com.vlv.aravali.playerMedia3.ui.PlayerBaseActivity;
import com.vlv.aravali.playerMedia3.ui.models.PlaybackState;
import com.vlv.aravali.premium.ui.PremiumTabParentFragment;
import com.vlv.aravali.profile.ui.fragments.C1518b;
import com.vlv.aravali.reels.model.v2.ReelV2;
import com.vlv.aravali.reelsTrailer.data.ReelTrailerData;
import com.vlv.aravali.reelsTrailer.view.ReelsTrailerActivity;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$BuyCourseNudge;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$CancelDownloadAllEpisodes;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$CancelDownloadEpisode;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$DeleteAllEpisodes;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$DeleteEpisode;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$DownloadAllEpisodes;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$DownloadEpisode;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$FailedDownloadAllDialog;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$OpenEnableNotification;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$OpenMobileAds;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$OpenPaywall;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$OpenSubscriptionPage;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$PlayPauseEpisode;
import com.vlv.aravali.showV2.ui.model.EpisodeScreenEvent$UnlockEpisode;
import com.vlv.aravali.signup.ui.activities.SignupActivity;
import in.juspay.hyper.constants.LogCategory;
import in.juspay.hyperinteg.ds.vJudY;
import j$.time.LocalDate;
import j$.time.LocalTime;
import j$.util.concurrent.ConcurrentHashMap;
import java.io.InputStream;
import java.lang.ref.WeakReference;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.WeakHashMap;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.text.StringsKt;
import nl.C2198b;
import org.json.JSONObject;
import pn.AbstractC2258c;
import pn.C2257b;

@Metadata
public final class MasterActivity extends Hilt_MasterActivity implements Hl.i {
    static final Gp.j[] $$delegatedProperties;
    public static final int $stable;
    public static final C1329g Companion;
    public static final String TAG = "MasterActivity";
    private final Np.k0 _shouldEnterPipFlow;
    private Integer currentEpisodeIndex;
    private String currentFromSource;
    private int currentShowId;
    private boolean isBottomPlayerViewed;
    private boolean isNavratriSpecialVideoTriggered;
    private boolean isRatingPopupPending;
    private boolean isRibbonAnimationInProgress;
    private boolean isUnlockDialogVisible;
    private boolean isVipBonusRibbonClosedManually;
    public Qn.t kukuFMChat;
    private int mAppUpdateType;
    private int mBottomFloatingHeight;
    private CoinSilentNotifData mCoinSilentNotifData;
    private final mp.m mCurrentBackStackDestinationId$delegate;
    private float mCurrentRating;
    private jb.f mDisplayShowRatingDialog;
    private Pk.l mInAppUpdateManager;
    private boolean mIsPressAgainToExitShown;
    private int mLastRibbonExtraShownOnEpisodeId;
    private long mMasterActivityStartTime;
    private final int[] mMiniPlayerNotVisibleIds;
    private v4.r mNavController;
    private HashMap<Integer, Integer> mNavIndexMap;
    private final Map<String, Function0<Unit>> mPendingTransactionMap;
    private Qn.x mPermissionHandler;
    private Tb.b mReviewManager;
    private String mRibbonSaleMessage;
    private PowerManager.WakeLock mWakeLock;
    private to.f mWearAuthDialog;
    private WifiManager.WifiLock mWifiLock;
    private final mp.m reelsEpisodeQueueViewModel$delegate;
    private final mp.m reelsViewModel$delegate;
    private final Np.D0 shouldEnterPipFlow;
    private Integer totalEpisodes;
    private final Ri.a mBinding$delegate = new Ri.a(AbstractC0493m.class);
    private final mp.m mBottomPlayerViewModel$delegate = new B4.v(kotlin.jvm.internal.J.a(C1110m.class), new c3(this, 4), new c3(this, 3), new c3(this, 5));
    private final mp.m mMasterViewModel$delegate = new B4.v(kotlin.jvm.internal.J.a(Vk.w0.class), new c3(this, 6), new com.vlv.aravali.coins.ui.activities.e(29), new c3(this, 7));
    private final ol.a mAppDisposable = new ol.a();

    static {
        Gp.j a = new kotlin.jvm.internal.A(MasterActivity.class, "mBinding", "getMBinding()Lcom/vlv/aravali/databinding/ActivityMasterBinding;", 0);
        kotlin.jvm.internal.J.a.getClass();
        $$delegatedProperties = new Gp.j[]{a};
        Companion = new C1329g();
        $stable = 8;
    }

    public MasterActivity() {
        String appUpdateType;
        int i = 0;
        int i2 = 10;
        Config config = Qn.e.f;
        Integer num = null;
        String appUpdateType2 = config != null ? config.getAppUpdateType() : null;
        if (appUpdateType2 == null || StringsKt.H(appUpdateType2)) {
            num = StringsKt.toIntOrNull(Pk.j.d("in_app_update"));
        } else {
            Config config2 = Qn.e.f;
            if (config2 != null && (appUpdateType = config2.getAppUpdateType()) != null) {
                num = StringsKt.toIntOrNull(appUpdateType);
            }
        }
        this.mAppUpdateType = num != null ? num.intValue() : -1;
        this.mMiniPlayerNotVisibleIds = new int[]{2131363935, 2131365583, 2131364638, 2131362852, 2131363942, 2131363943};
        this.mCurrentBackStackDestinationId$delegate = mp.o.b(new V4.g(this, 10));
        this.mNavIndexMap = new HashMap<>();
        this.mPendingTransactionMap = new ConcurrentHashMap();
        this.totalEpisodes = 0;
        this.currentEpisodeIndex = 0;
        this.currentShowId = -1;
        this.reelsViewModel$delegate = new B4.v(kotlin.jvm.internal.J.a(Em.v.class), new c3(this, 9), new c3(this, 8), new c3(this, i2));
        this.reelsEpisodeQueueViewModel$delegate = new B4.v(kotlin.jvm.internal.J.a(Em.m.class), new c3(this, 1), new c3(this, i), new c3(this, 2));
        Np.F0 a = Np.G0.a(Boolean.TRUE);
        this._shouldEnterPipFlow = a;
        this.shouldEnterPipFlow = new Np.m0(a);
    }

    public static final Unit addFragment$lambda$7(MasterActivity masterActivity, Fragment fragment, String str) {
        masterActivity.addFragment(fragment, str);
        return Unit.a;
    }

    private final void addMoEngageInAppPopupEventsAndCustomHandling() {
        if (pg.a.b == null) {
            synchronized (pg.a.class) {
                try {
                    pg.a aVar = pg.a.b;
                    if (aVar == null) {
                        aVar = new pg.a(0);
                    }
                    pg.a.b = aVar;
                } finally {
                }
            }
        }
        C1333h c1333h = new C1333h();
        Intrinsics.checkNotNullParameter(c1333h, "listener");
        nf.F f = Je.t.c;
        if (f != null) {
            qg.H.a(f).g.add(c1333h);
        }
        if (pg.a.b == null) {
            synchronized (pg.a.class) {
                try {
                    pg.a aVar2 = pg.a.b;
                    if (aVar2 == null) {
                        aVar2 = new pg.a(0);
                    }
                    pg.a.b = aVar2;
                } catch (Throwable th) {
                    throw th;
                }
            }
        }
        com.vlv.aravali.downloadsV2.ui.f fVar = new com.vlv.aravali.downloadsV2.ui.f(this, 13);
        nf.F f2 = Je.t.c;
        if (f2 == null) {
            return;
        }
        qg.H.a(f2).f = fVar;
    }

    public static final boolean addMoEngageInAppPopupEventsAndCustomHandling$lambda$56(MasterActivity masterActivity, Tg.b bVar) {
        Intrinsics.checkNotNullParameter(bVar, "clickData");
        JSONObject jSONObject = new JSONObject();
        Ug.b bVar2 = bVar.d;
        boolean z = bVar2 instanceof Ug.b;
        uo.a aVar = ((Tg.c) bVar).c;
        if (!z) {
            if (!(bVar2 instanceof Ug.c)) {
                return true;
            }
            Ug.c cVar = (Ug.c) bVar2;
            Uri parse = Uri.parse(cVar.c);
            Intrinsics.checkNotNullExpressionValue(parse, "parse(...)");
            openedViaDeepLink$default(masterActivity, parse, null, null, null, 14, null);
            Bi.k r = io.sentry.config.d.r(KukuFMApplication.x, "in_app_popup_navigation");
            r.c((String) aVar.c, "ct_campaign");
            r.c("MoE", "source");
            r.c(cVar.b.toString(), "navigation_type");
            r.c(cVar.c, "navigation_link");
            r.d();
            HashMap hashMap = cVar.d;
            if (hashMap == null) {
                return true;
            }
            for (Map.Entry entry : hashMap.entrySet()) {
                String upperCase = ((String) entry.getKey()).toUpperCase(Locale.ROOT);
                Intrinsics.checkNotNullExpressionValue(upperCase, "toUpperCase(...)");
                boolean c = Intrinsics.c(upperCase, "BUTTON");
                String str = (String) aVar.c;
                if (c) {
                    Bi.k g = androidx.datastore.preferences.protobuf.o.g(KukuFMApplication.x, "in_app_popup_button_clicked", "ct_campaign", str);
                    g.c("MoE", "source");
                    g.d();
                } else if (Intrinsics.c(upperCase, "IMAGE")) {
                    Bi.k g2 = androidx.datastore.preferences.protobuf.o.g(KukuFMApplication.x, "in_app_popup_image_clicked", "ct_campaign", str);
                    g2.c("MoE", "source");
                    g2.d();
                } else {
                    Bi.k l = KukuFMApplication.x.B().d().l((String) entry.getKey());
                    l.c(entry.getValue(), "in_app_action_value");
                    l.c(str, "ct_campaign");
                    l.c("MoE", "source");
                    l.d();
                }
            }
            return true;
        }
        HashMap hashMap2 = bVar2.b;
        String str2 = "";
        if (hashMap2 != null) {
            Iterator it = hashMap2.entrySet().iterator();
            while (it.hasNext()) {
                Map.Entry entry2 = (Map.Entry) it.next();
                String upperCase2 = ((String) entry2.getKey()).toUpperCase(Locale.ROOT);
                Intrinsics.checkNotNullExpressionValue(upperCase2, "toUpperCase(...)");
                int hashCode = upperCase2.hashCode();
                Iterator it2 = it;
                if (hashCode == 69775675) {
                    if (upperCase2.equals("IMAGE")) {
                        Bi.k r2 = io.sentry.config.d.r(KukuFMApplication.x, "in_app_popup_image_clicked");
                        r2.c((String) aVar.c, "ct_campaign");
                        r2.c("MoE", "source");
                        r2.d();
                    }
                    jSONObject.put((String) entry2.getKey(), entry2.getValue());
                    Bi.k l2 = KukuFMApplication.x.B().d().l((String) entry2.getKey());
                    l2.c(entry2.getValue(), "in_app_action_value");
                    l2.c((String) aVar.c, "ct_campaign");
                    l2.c("MoE", "source");
                    l2.d();
                } else if (hashCode != 1356731628) {
                    if (hashCode == 1970608946 && upperCase2.equals("BUTTON")) {
                        Bi.k r3 = io.sentry.config.d.r(KukuFMApplication.x, "in_app_popup_button_clicked");
                        r3.c((String) aVar.c, "ct_campaign");
                        r3.c("MoE", "source");
                        r3.d();
                    }
                    jSONObject.put((String) entry2.getKey(), entry2.getValue());
                    Bi.k l22 = KukuFMApplication.x.B().d().l((String) entry2.getKey());
                    l22.c(entry2.getValue(), "in_app_action_value");
                    l22.c((String) aVar.c, "ct_campaign");
                    l22.c("MoE", "source");
                    l22.d();
                } else {
                    if (upperCase2.equals("END_POINT")) {
                        String obj = entry2.getValue().toString();
                        Bi.k r4 = io.sentry.config.d.r(KukuFMApplication.x, "in_app_popup_end_point_received");
                        r4.c((String) aVar.c, "ct_campaign");
                        r4.c("MoE", "source");
                        r4.c(obj, "end_point");
                        r4.d();
                        str2 = obj;
                    }
                    jSONObject.put((String) entry2.getKey(), entry2.getValue());
                    Bi.k l222 = KukuFMApplication.x.B().d().l((String) entry2.getKey());
                    l222.c(entry2.getValue(), "in_app_action_value");
                    l222.c((String) aVar.c, "ct_campaign");
                    l222.c("MoE", "source");
                    l222.d();
                }
                it = it2;
            }
        }
        if (!jSONObject.getBoolean("call_api")) {
            return true;
        }
        Vk.w0 mMasterViewModel = masterActivity.getMMasterViewModel();
        mMasterViewModel.getClass();
        Intrinsics.checkNotNullParameter(str2, "endPoint");
        Intrinsics.checkNotNullParameter(jSONObject, "data");
        Kp.p.w(androidx.lifecycle.i0.k(mMasterViewModel), (CoroutineContext) null, (Kp.J) null, new Vk.q0(mMasterViewModel, str2, jSONObject, null), 3);
        return true;
    }

    public static void addStoreFragment$default(MasterActivity masterActivity, String str, SubscriptionMeta subscriptionMeta, boolean z, int i, int i2, Object obj) {
        if ((i2 & 1) != 0) {
            str = null;
        }
        if ((i2 & 4) != 0) {
            z = true;
        }
        if ((i2 & 8) != 0) {
            i = 0;
        }
        masterActivity.addStoreFragment(str, subscriptionMeta, z, i);
    }

    private final void authenticateUser(Boolean bool) {
        androidx.lifecycle.B i = androidx.lifecycle.i0.i(this);
        Sp.f fVar = Kp.V.a;
        Kp.p.w(i, Sp.e.c, (Kp.J) null, new C1349l(bool, this, null), 2);
    }

    public static void authenticateUser$default(MasterActivity masterActivity, Boolean bool, int i, Object obj) {
        if ((i & 1) != 0) {
            bool = Boolean.TRUE;
        }
        masterActivity.authenticateUser(bool);
    }

    public final void autoPlayReelTrailer(ReelTrailerData reelTrailerData) {
        Intent intent = new Intent((Context) this, (Class<?>) ReelsTrailerActivity.class);
        Bundle bundle = new Bundle();
        bundle.putParcelable("source_data", reelTrailerData);
        intent.putExtras(bundle);
        startActivity(intent);
    }

    public final void autoPlayWithNavigation(Show show, MasterConfig.CampaignData campaignData) {
        String autoPlayNavigationUri;
        if (campaignData != null && (autoPlayNavigationUri = campaignData.getAutoPlayNavigationUri()) != null) {
            Uri parse = Uri.parse(autoPlayNavigationUri);
            Intrinsics.checkNotNullExpressionValue(parse, "parse(...)");
            openedViaDeepLink$default(this, parse, null, null, null, 14, null);
        }
        autoplayInFullPlayerViaShowPage(show);
    }

    public final void autoplayInFullPlayer(Show show) {
        s4.x controller;
        CUPart resumeEpisode = show.getResumeEpisode();
        if (resumeEpisode == null) {
            Bi.k g = androidx.datastore.preferences.protobuf.o.g(KukuFMApplication.x, "d0_autoplay_error", "error_message", "resume episode not found");
            g.c("autoplayInFullPlayer", "source");
            g.d();
            return;
        }
        if (getPlayingEpisodeFlow().getValue() != null || (controller = getController()) == null || controller.isPlaying()) {
            AbstractC0210b.v(KukuFMApplication.x, "d0_autoplay_error", "error_message", "already playing");
        } else {
            PlayerBaseActivity.playOrPause$default(this, resumeEpisode, show, kotlin.collections.x.c(resumeEpisode), "home_auto_play_new_user", "home_screen", show.getContentSource(), false, false, true, 192, null);
            Bi.k r = io.sentry.config.d.r(KukuFMApplication.x, "auto_played_in_full_player");
            Object id = show.getId();
            if (id == null) {
                id = "";
            }
            r.c(id, "show_id");
            Integer id2 = resumeEpisode.getId();
            r.c(id2 != null ? id2 : "", "episode_id");
            r.d();
        }
        Bi.k r2 = io.sentry.config.d.r(KukuFMApplication.x, "first_episode_autoplay");
        r2.c(show.getId(), "show_id");
        r2.c(resumeEpisode.getId(), "episode_id");
        r2.c("full_player", "type");
        r2.d();
    }

    public final void autoplayInFullPlayerViaShowPage(Show show) {
        String slug;
        Integer id = show.getId();
        if (id == null || (slug = show.getSlug()) == null) {
            return;
        }
        EventData eventData = new EventData("home_screen", "banner_auto", "for_you", null, null, null, null, null, null, false, null, null, false, null, null, null, null, null, null, null, null, null, false, 8388600, null);
        if (D8.i.A0()) {
            List list = Qn.m.a;
            CUPart resumeEpisode = show.getResumeEpisode();
            if (resumeEpisode != null) {
                PlayerBaseActivity.playOrPause$default(this, resumeEpisode, show, kotlin.collections.x.c(resumeEpisode), j.e.f(eventData.getSectionSlug(), "-", eventData.getScreenName()), j.e.f(eventData.getSectionSlug(), "-", eventData.getScreenName()), j.e.f(eventData.getSectionSlug(), "-", eventData.getScreenName()), true, false, true, 128, null);
            } else {
                PlayerBaseActivity.playOrPause$default(this, id, slug, j.e.f(eventData.getSectionSlug(), "-", eventData.getScreenName()), j.e.f(eventData.getSectionSlug(), "-", eventData.getScreenName()), j.e.f(eventData.getSectionSlug(), "-", eventData.getScreenName()), true, false, true, 64, null);
            }
        } else {
            v4.r rVar = this.mNavController;
            if (rVar != null) {
                I5.g.Z(rVar, id, slug, false, "play", eventData, (Uri) null, (String) null, false, 1992);
            }
        }
        Ai.p pVar = KukuFMApplication.x;
        SharedPreferences.Editor edit = pVar.B().h().a.a.edit();
        edit.putBoolean("is_campaign_cu_played", true);
        edit.apply();
        if (pVar.B().h().i().length() == 0) {
            androidx.datastore.preferences.protobuf.o.r(pVar, "organic_user_auto_navigation");
        }
        Bi.k r = io.sentry.config.d.r(pVar, "first_episode_autoplay");
        r.c(show.getId(), "show_id");
        CUPart resumeEpisode2 = show.getResumeEpisode();
        r.c(resumeEpisode2 != null ? resumeEpisode2.getId() : null, "episode_id");
        r.c("full_player_via_show_page", "type");
        r.d();
    }

    public final void autoplayInMiniPlayer(Show show, boolean z) {
        s4.x controller;
        CUPart resumeEpisode = show.getResumeEpisode();
        if (resumeEpisode == null) {
            Bi.k g = androidx.datastore.preferences.protobuf.o.g(KukuFMApplication.x, "d0_autoplay_error", "error_message", "resume episode not found");
            g.c("autoplayInMiniPlayer", "source");
            g.d();
            return;
        }
        if (getPlayingEpisodeFlow().getValue() != null || (controller = getController()) == null || controller.isPlaying()) {
            AbstractC0210b.v(KukuFMApplication.x, "d0_autoplay_error", "error_message", "already playing");
        } else {
            PlayerBaseActivity.playOrPause$default(this, resumeEpisode, show, kotlin.collections.x.c(resumeEpisode), "home_auto_play_new_user", "home_screen", show.getContentSource(), false, !z, false, 64, null);
            Bi.k r = io.sentry.config.d.r(KukuFMApplication.x, "auto_played_in_mini_player");
            Object id = show.getId();
            if (id == null) {
                id = "";
            }
            r.c(id, "show_id");
            Integer id2 = resumeEpisode.getId();
            r.c(id2 != null ? id2 : "", "episode_id");
            r.d();
        }
        Bi.k r2 = io.sentry.config.d.r(KukuFMApplication.x, "first_episode_autoplay");
        r2.c(show.getId(), "show_id");
        r2.c(resumeEpisode.getId(), "episode_id");
        r2.c(z ? "mini_player" : "mini_player_paused", "type");
        r2.d();
    }

    private final void buyPack(Pack pack, Show show, String str, boolean z) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1353m(pack, show, this, str, z, null), 3);
    }

    public static void buyPack$default(MasterActivity masterActivity, Pack pack, Show show, String str, boolean z, int i, Object obj) {
        if ((i & 8) != 0) {
            z = false;
        }
        masterActivity.buyPack(pack, show, str, z);
    }

    public final void buySubscriptionPack(PlanDetailItem planDetailItem) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1357n(planDetailItem, this, null), 3);
    }

    public final Object deleteEventFromCalendar(long j, pp.c<? super Long> cVar) {
        Sp.f fVar = Kp.V.a;
        return Kp.p.C(Sp.e.c, new C1361o(this, j, null), cVar);
    }

    public final void displayShowRatingBSDialog(final Show show) {
        String string;
        Ai.p pVar = KukuFMApplication.x;
        final jb.f fVar = new jb.f(this, com.vlv.aravali.audiobooks.ui.fragments.p.x(pVar) ? 2132082998 : 2132082997);
        this.mDisplayShowRatingDialog = fVar;
        LayoutInflater layoutInflater = getLayoutInflater();
        int i = J4.Z;
        final J4 j4 = (J4) x2.e.b(layoutInflater, 2131558682, (ViewGroup) null, false);
        Intrinsics.checkNotNullExpressionValue(j4, "inflate(...)");
        boolean z = Qk.f.a;
        AppCompatImageView appCompatImageView = j4.X;
        Intrinsics.checkNotNullExpressionValue(appCompatImageView, "thumbnailIvReview");
        Qk.f.i(appCompatImageView, show.getImage());
        ContentType contentType = show.getContentType();
        if (contentType == null || (string = contentType.getTitle()) == null) {
            string = getResources().getString(2132018544);
            Intrinsics.checkNotNullExpressionValue(string, "getString(...)");
        }
        j4.Y.setText(new StringBuilder(Ai.o.h("Hope you enjoyed this ", string)));
        j4.L.setOnClickListener(new Pm.c(fVar, 5));
        j4.Q.setOnRatingBarChangeListener(new RatingBar.OnRatingBarChangeListener() {
            @Override
            public final void onRatingChanged(RatingBar ratingBar, float f, boolean z2) {
                MasterActivity.displayShowRatingBSDialog$lambda$51$lambda$50(MasterActivity.this, show, fVar, j4, ratingBar, f, z2);
            }
        });
        Bi.k l = pVar.B().d().l("rating_nudge_viewed");
        l.c(show.getTitle(), "show_title");
        l.d();
        fVar.setContentView(((x2.m) j4).d);
        if (isFinishing()) {
            return;
        }
        Kp.p.w(androidx.lifecycle.i0.i(this), Qp.m.a, (Kp.J) null, new C1369q(fVar, null), 2);
    }

    public static final void displayShowRatingBSDialog$lambda$51$lambda$50(MasterActivity masterActivity, Show show, jb.f fVar, J4 j4, RatingBar ratingBar, float f, boolean z) {
        Vk.w0 mMasterViewModel = masterActivity.getMMasterViewModel();
        int b = Bp.c.b(f);
        int b2 = Bp.c.b(f);
        int b3 = Bp.c.b(f);
        Integer id = show.getId();
        int intValue = id != null ? id.intValue() : 0;
        mMasterViewModel.getClass();
        Kp.p.w(androidx.lifecycle.i0.k(mMasterViewModel), (CoroutineContext) null, (Kp.J) null, new Vk.l0(mMasterViewModel, b, b2, b3, intValue, null), 3);
        fVar.dismiss();
        Ai.p pVar = KukuFMApplication.x;
        Bi.k r = io.sentry.config.d.r(pVar, "rating_nudge_submitted");
        r.c(show.getTitle(), "show_title");
        r.d();
        float rating = j4.Q.getRating();
        if (rating > 0.0f) {
            Kp.p.w(androidx.lifecycle.i0.i(masterActivity), Sp.e.c, (Kp.J) null, new C1365p(show, null), 2);
        }
        if (rating == 5.0f) {
            Config config = Qn.e.f;
            if (config != null ? Intrinsics.c(config.isNotInternationalSession(), Boolean.TRUE) : false) {
                pVar.B().h().X("AppRating");
                masterActivity.showInviteNudgeDialog();
            }
        }
    }

    private final void doWhenSubscribeClicked(String str, int i) {
        Integer id;
        Integer id2;
        String str2;
        Pair pair = Qn.e.g;
        if (pair != null && (str2 = (String) pair.b) != null) {
            Qn.e.c = Uri.parse(str2);
        }
        Bi.k g = androidx.datastore.preferences.protobuf.o.g(KukuFMApplication.x, "view_all_plans_clicked", "source", "reels");
        g.c(str, "player_source");
        g.g(false);
        Show show = (Show) getPlayingShowFlow().getValue();
        int i2 = -1;
        Integer valueOf = Integer.valueOf((show == null || (id2 = show.getId()) == null) ? -1 : id2.intValue());
        CUPart cUPart = (CUPart) getPlayingEpisodeFlow().getValue();
        if (cUPart != null && (id = cUPart.getId()) != null) {
            i2 = id.intValue();
        }
        Integer valueOf2 = Integer.valueOf(i2);
        Show show2 = (Show) getPlayingShowFlow().getValue();
        SubscriptionMeta subscriptionMeta = new SubscriptionMeta(str, valueOf, valueOf2, null, null, null, show2 != null ? show2.getImage() : null, null, null, null, Integer.valueOf(i), null, null, false, null, null, null, null, null, 523192, null);
        kp.b bVar = nl.a.a;
        nl.a.b(new C2198b(ij.i.NAVIGATE_TO_SUBSCRIPTION_FLOW, subscriptionMeta));
        getReelsViewModel().f(Cm.a.HIDDEN);
    }

    public static void doWhenSubscribeClicked$default(MasterActivity masterActivity, String str, int i, int i2, Object obj) {
        if ((i2 & 2) != 0) {
            i = 0;
        }
        masterActivity.doWhenSubscribeClicked(str, i);
    }

    private final void downloadEvent(String str, Show show, CUPart cUPart) {
        String str2;
        Integer id;
        Ai.p pVar = KukuFMApplication.x;
        Bi.k kVar = new Bi.k(pVar.B().d());
        kVar.k(str);
        Object obj = "";
        if (show == null || (str2 = show.getTitle()) == null) {
            str2 = "";
        }
        kVar.c(str2, "show_title");
        if (show != null && (id = show.getId()) != null) {
            obj = id;
        }
        kVar.c(obj, "show_id");
        kVar.c(cUPart != null ? cUPart.getId() : null, "episode_id");
        User z = pVar.B().h().z();
        kVar.c(z != null ? z.getId() : null, "user_id");
        Integer id2 = show != null ? show.getId() : null;
        Show show2 = (Show) getPlayingShowFlow().getValue();
        kVar.c(Boolean.valueOf(Intrinsics.c(id2, show2 != null ? show2.getId() : null)), "episode_play_status");
        kVar.d();
    }

    public static void downloadEvent$default(MasterActivity masterActivity, String str, Show show, CUPart cUPart, int i, Object obj) {
        if ((i & 2) != 0) {
            show = null;
        }
        if ((i & 4) != 0) {
            cUPart = null;
        }
        masterActivity.downloadEvent(str, show, cUPart);
    }

    public final void exitOnBackPress() {
        if (!this.mIsPressAgainToExitShown) {
            this.mIsPressAgainToExitShown = true;
            Toast.makeText((Context) this, (CharSequence) getString(2132017602), 0).show();
            new Handler(Looper.getMainLooper()).postDelayed(new RunnableC1321e(this, 0), 2000L);
        } else {
            Bi.k l = KukuFMApplication.x.B().d().l("onboarding_back_to_exit_clicked");
            l.c(TAG, "screen_name");
            l.d();
            finish();
        }
    }

    public final void getDailyRewards() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1384u(this, null), 3);
    }

    private final void getIntentExtras() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1388v(this, null), 3);
    }

    public final AbstractC0493m getMBinding() {
        return this.mBinding$delegate.a(this, $$delegatedProperties[0]);
    }

    public final C1110m getMBottomPlayerViewModel() {
        return (C1110m) this.mBottomPlayerViewModel$delegate.getValue();
    }

    public final Np.k getMCurrentBackStackDestinationId() {
        return (Np.k) this.mCurrentBackStackDestinationId$delegate.getValue();
    }

    public final Vk.w0 getMMasterViewModel() {
        return (Vk.w0) this.mMasterViewModel$delegate.getValue();
    }

    public final Em.m getReelsEpisodeQueueViewModel() {
        return (Em.m) this.reelsEpisodeQueueViewModel$delegate.getValue();
    }

    public final Em.v getReelsViewModel() {
        return (Em.v) this.reelsViewModel$delegate.getValue();
    }

    public final void handleMlPopupEvents(Wk.b bVar) {
        if (bVar instanceof Wk.a) {
            getMMasterViewModel().m();
            getMBinding().m0.setVisibility(8);
            Bi.k r = io.sentry.config.d.r(KukuFMApplication.x, "ml_popup_dismissed");
            r.c(getMMasterViewModel().l().getPopupType().toString(), "type");
            r.c(Integer.valueOf(getMMasterViewModel().l().getShowId()), "show_id");
            r.c(getMMasterViewModel().l().getShowSlug(), "show_slug");
            r.c(Bi.y.a(), "timestamp");
            r.d();
            return;
        }
        if (bVar instanceof MlPopupEvents$GetButtonClicked) {
            Vk.w0 mMasterViewModel = getMMasterViewModel();
            MlPopupEvents$GetButtonClicked mlPopupEvents$GetButtonClicked = (MlPopupEvents$GetButtonClicked) bVar;
            int showId = mlPopupEvents$GetButtonClicked.getShowId();
            String showSlug = mlPopupEvents$GetButtonClicked.getShowSlug();
            Wk.g type = mlPopupEvents$GetButtonClicked.getType();
            mMasterViewModel.getClass();
            Intrinsics.checkNotNullParameter(showSlug, "showSlug");
            Intrinsics.checkNotNullParameter(type, "type");
            Kp.p.w(androidx.lifecycle.i0.k(mMasterViewModel), (CoroutineContext) null, (Kp.J) null, new Vk.j0(mMasterViewModel, showId, showSlug, type, null), 3);
            Bi.k r2 = io.sentry.config.d.r(KukuFMApplication.x, "ml_popup_clicked");
            r2.c(getMMasterViewModel().l().getPopupType().toString(), "type");
            r2.c(Integer.valueOf(getMMasterViewModel().l().getShowId()), "show_id");
            r2.c(getMMasterViewModel().l().getShowSlug(), "show_slug");
            r2.c(Bi.y.a(), "timestamp");
            r2.d();
        }
    }

    public final void handleMoreLikeThisData(MoreLikeThisData moreLikeThisData) {
        if (moreLikeThisData == null || moreLikeThisData.getShows().isEmpty() || !shouldShowDialog()) {
            return;
        }
        androidx.fragment.app.j0 supportFragmentManager = getSupportFragmentManager();
        Intrinsics.checkNotNullExpressionValue(supportFragmentManager, "getSupportFragmentManager(...)");
        if (supportFragmentManager.U("more_like_this_dialog") == null) {
            com.vlv.aravali.moreLikeThis.ui.c cVar = com.vlv.aravali.moreLikeThis.ui.f.Companion;
            int i = this.currentShowId;
            String str = this.currentFromSource;
            if (str == null) {
                Intrinsics.m("currentFromSource");
                throw null;
            }
            cVar.getClass();
            com.vlv.aravali.moreLikeThis.ui.c.a(i, str, moreLikeThisData).show(supportFragmentManager, "more_like_this_dialog");
        }
        String str2 = this.currentFromSource;
        if (str2 == null) {
            Intrinsics.m("currentFromSource");
            throw null;
        }
        if (!str2.equals("less_than_ten_perc_content_left")) {
            KukuFMApplication.x.B().h().F(true);
        }
        String str3 = this.currentFromSource;
        if (str3 == null) {
            Intrinsics.m("currentFromSource");
            throw null;
        }
        if (str3.equals("one_min_inactivity")) {
            Ai.o.C(KukuFMApplication.x.B().h().a.a, "mlt_one_minute_shown", true);
        }
        getMMasterViewModel().i.m((Object) null);
    }

    public final void handleReelsEpisodeQueueEvent(AbstractC2258c abstractC2258c) {
        if (abstractC2258c instanceof EpisodeScreenEvent$CancelDownloadAllEpisodes) {
            EpisodeScreenEvent$CancelDownloadAllEpisodes episodeScreenEvent$CancelDownloadAllEpisodes = (EpisodeScreenEvent$CancelDownloadAllEpisodes) abstractC2258c;
            downloadEvent$default(this, "player_episodes_cancel_downloads_all_episodes_click", episodeScreenEvent$CancelDownloadAllEpisodes.getShow(), null, 4, null);
            cancelDownload(episodeScreenEvent$CancelDownloadAllEpisodes.getShow());
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$DeleteAllEpisodes) {
            EpisodeScreenEvent$DeleteAllEpisodes episodeScreenEvent$DeleteAllEpisodes = (EpisodeScreenEvent$DeleteAllEpisodes) abstractC2258c;
            downloadEvent$default(this, "player_episodes_delete_all_episodes_click", episodeScreenEvent$DeleteAllEpisodes.getShow(), null, 4, null);
            A8.w.r(this, episodeScreenEvent$DeleteAllEpisodes.getShow(), this);
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$DownloadAllEpisodes) {
            EpisodeScreenEvent$DownloadAllEpisodes episodeScreenEvent$DownloadAllEpisodes = (EpisodeScreenEvent$DownloadAllEpisodes) abstractC2258c;
            downloadEvent$default(this, "player_episodes_download_all_episodes_click", episodeScreenEvent$DownloadAllEpisodes.getShow(), null, 4, null);
            startDownload(episodeScreenEvent$DownloadAllEpisodes.getShow(), null);
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$FailedDownloadAllDialog) {
            EpisodeScreenEvent$FailedDownloadAllDialog episodeScreenEvent$FailedDownloadAllDialog = (EpisodeScreenEvent$FailedDownloadAllDialog) abstractC2258c;
            downloadEvent$default(this, "player_episodes_failed_download_all_dialog", episodeScreenEvent$FailedDownloadAllDialog.getShow(), null, 4, null);
            A8.w.r(this, episodeScreenEvent$FailedDownloadAllDialog.getShow(), this);
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$CancelDownloadEpisode) {
            EpisodeScreenEvent$CancelDownloadEpisode episodeScreenEvent$CancelDownloadEpisode = (EpisodeScreenEvent$CancelDownloadEpisode) abstractC2258c;
            downloadEvent("player_episodes_cancel_download_episode_click", episodeScreenEvent$CancelDownloadEpisode.getShow(), episodeScreenEvent$CancelDownloadEpisode.getCuPart());
            if (episodeScreenEvent$CancelDownloadEpisode.getShow() != null) {
                cancelDownload(episodeScreenEvent$CancelDownloadEpisode.getCuPart(), episodeScreenEvent$CancelDownloadEpisode.getShow());
                return;
            }
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$DeleteEpisode) {
            EpisodeScreenEvent$DeleteEpisode episodeScreenEvent$DeleteEpisode = (EpisodeScreenEvent$DeleteEpisode) abstractC2258c;
            downloadEvent("player_episodes_delete_episode_click", episodeScreenEvent$DeleteEpisode.getShow(), episodeScreenEvent$DeleteEpisode.getCuPart());
            A8.w.q(this, episodeScreenEvent$DeleteEpisode.getCuPart(), this, episodeScreenEvent$DeleteEpisode.getShow());
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$DownloadEpisode) {
            EpisodeScreenEvent$DownloadEpisode episodeScreenEvent$DownloadEpisode = (EpisodeScreenEvent$DownloadEpisode) abstractC2258c;
            downloadEvent("player_episodes_download_episode_click", episodeScreenEvent$DownloadEpisode.getShow(), episodeScreenEvent$DownloadEpisode.getCuPart());
            if (episodeScreenEvent$DownloadEpisode.getShow() != null) {
                startDownload(episodeScreenEvent$DownloadEpisode.getShow(), episodeScreenEvent$DownloadEpisode.getCuPart());
                return;
            }
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$OpenEnableNotification) {
            checkNotificationPermission(true);
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$PlayPauseEpisode) {
            Em.v reelsViewModel = getReelsViewModel();
            EpisodeScreenEvent$PlayPauseEpisode episodeScreenEvent$PlayPauseEpisode = (EpisodeScreenEvent$PlayPauseEpisode) abstractC2258c;
            Show copy$default = Show.copy$default(episodeScreenEvent$PlayPauseEpisode.getShow(), null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, 0, 0, false, null, null, episodeScreenEvent$PlayPauseEpisode.getEpisode(), null, null, null, null, null, null, null, false, null, null, 0, 0, 0, null, null, null, null, null, null, null, null, null, null, null, false, null, false, null, null, null, null, false, false, null, null, null, null, null, null, null, null, null, null, null, null, false, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, false, null, null, null, null, null, null, false, null, null, null, null, null, false, null, null, null, null, null, false, null, null, null, -1, -17, -1, 536870911, null);
            reelsViewModel.getClass();
            Intrinsics.checkNotNullParameter(copy$default, "newRootShow");
            Kp.p.w(androidx.lifecycle.i0.k(reelsViewModel), (CoroutineContext) null, (Kp.J) null, new Em.p(reelsViewModel, copy$default, null), 3);
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$BuyCourseNudge) {
            showToast("Buy this course to unlock this chapter!", 0);
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$UnlockEpisode) {
            Kp.p.w(androidx.lifecycle.i0.k(getReelsViewModel()), (CoroutineContext) null, (Kp.J) null, new C1396x(this, abstractC2258c, null), 3);
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$OpenMobileAds) {
            EpisodeScreenEvent$OpenMobileAds episodeScreenEvent$OpenMobileAds = (EpisodeScreenEvent$OpenMobileAds) abstractC2258c;
            openMobileAds(episodeScreenEvent$OpenMobileAds.getShowId(), episodeScreenEvent$OpenMobileAds.getSource(), episodeScreenEvent$OpenMobileAds.getEpisodeId());
            return;
        }
        if (abstractC2258c instanceof EpisodeScreenEvent$OpenSubscriptionPage) {
            doWhenSubscribeClicked$default(this, "reels", 0, 2, null);
            return;
        }
        if (abstractC2258c instanceof C2257b) {
            Np.F0 f0 = getReelsEpisodeQueueViewModel().d;
            do {
            } while (!f0.l(f0.getValue(), Boolean.valueOf(!((Boolean) r0).booleanValue())));
        } else if (abstractC2258c instanceof EpisodeScreenEvent$OpenPaywall) {
            Np.F0 f02 = getReelsViewModel().L;
            Boolean bool = Boolean.TRUE;
            f02.getClass();
            f02.n((Object) null, bool);
            EpisodeScreenEvent$OpenPaywall episodeScreenEvent$OpenPaywall = (EpisodeScreenEvent$OpenPaywall) abstractC2258c;
            getReelsViewModel().e(episodeScreenEvent$OpenPaywall.getClickedEpisode(), episodeScreenEvent$OpenPaywall.getShow());
        }
    }

    public final void handleShareChooseIntent(Intent intent) {
        if (intent != null) {
            String type = intent.getType();
            String action = intent.getAction();
            ArrayList arrayList = new ArrayList();
            if (type != null && kotlin.text.y.o(type, "audio/", false) && Intrinsics.c(action, "android.intent.action.SEND")) {
                Bundle extras = intent.getExtras();
                Object obj = extras != null ? extras.get("android.intent.extra.STREAM") : null;
                Intrinsics.f(obj, "null cannot be cast to non-null type android.net.Uri");
                arrayList.add((Uri) obj);
                androidx.lifecycle.B i = androidx.lifecycle.i0.i(this);
                Sp.f fVar = Kp.V.a;
                Kp.p.w(i, Qp.m.a, (Kp.J) null, new C1400y(this, null), 2);
            }
        }
    }

    public final void handleStarClick(AppCompatImageView appCompatImageView, int i, String str) {
        this.isRatingPopupPending = false;
        appCompatImageView.setOnClickListener(new Bk.N(i, 7, this, str));
    }

    public static final void handleStarClick$lambda$36(int i, MasterActivity masterActivity, String str, View view) {
        float f = i + 1;
        if (masterActivity.mCurrentRating == f) {
            masterActivity.updateStars(0.0f, str);
        } else {
            masterActivity.updateStars(f, str);
        }
    }

    private final void handleTemplateCTNotifications(Intent intent) {
        Bundle extras = intent != null ? intent.getExtras() : null;
        if (extras != null && extras.containsKey("pt_id") && Intrinsics.c(extras.get("pt_id"), "pt_rating")) {
            KukuFMApplication kukuFMApplication = Pk.h.a;
            Object systemService = Pk.h.a.getSystemService("notification");
            Intrinsics.f(systemService, "null cannot be cast to non-null type android.app.NotificationManager");
            Object obj = extras.get("notificationId");
            Intrinsics.f(obj, "null cannot be cast to non-null type kotlin.Int");
            ((NotificationManager) systemService).cancel(((Integer) obj).intValue());
        }
        if (extras != null && extras.containsKey("pt_id") && Intrinsics.c(extras.get("pt_id"), "pt_product_display")) {
            KukuFMApplication kukuFMApplication2 = Pk.h.a;
            Object systemService2 = Pk.h.a.getSystemService("notification");
            Intrinsics.f(systemService2, "null cannot be cast to non-null type android.app.NotificationManager");
            Object obj2 = extras.get("notificationId");
            Intrinsics.f(obj2, "null cannot be cast to non-null type kotlin.Int");
            ((NotificationManager) systemService2).cancel(((Integer) obj2).intValue());
        }
    }

    public final void hideBottomNavAndRelatedElements() {
        getMBinding().Q.setVisibility(8);
        hideSaleBadge();
    }

    public final void hideBottomPlayer2() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new A(this, null), 3);
    }

    public final void hideLoader() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C(this, null), 3);
    }

    private final void hideSaleBadge() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new F(this, null), 3);
    }

    public final void hideVipBonusRibbon() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new G(this, null), 3);
    }

    public final void initAppRatingFeature() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new H(this, null), 3);
    }

    private final void initAppShortcutFlow() {
        if (!Intrinsics.c(getIntent().getAction(), "android.intent.action.VIEW") || getIntent().getStringExtra("shortcut_id") == null) {
            return;
        }
        androidx.datastore.preferences.protobuf.o.r(KukuFMApplication.x, "user_free_session_shortcut_flow_started");
        ArrayList arrayList = Qn.e.a;
        Qn.e.v = true;
    }

    public final void initBottomPlayer() {
        AbstractC0493m mBinding = getMBinding();
        C0513n c0513n = (C0513n) mBinding;
        c0513n.V0 = getMBottomPlayerViewModel();
        synchronized (c0513n) {
            c0513n.X0 |= 64;
        }
        c0513n.notifyPropertyChanged(33);
        c0513n.q();
        mBinding.w(getMBottomPlayerViewModel().b);
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new L(this, null), 3);
    }

    public final void initCoinBasedFeature() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new M(this, null), 3);
    }

    private final void initDebugModeIndicator() {
    }

    public final void initDynamicAppShortcutFeatures(boolean z) {
        ArrayList arrayList;
        IconCompat iconCompat;
        int i;
        InputStream i2;
        Bitmap decodeStream;
        IconCompat c;
        if (!z) {
            Intrinsics.checkNotNullParameter(this, LogCategory.CONTEXT);
            Intrinsics.checkNotNullParameter("free_session", "shortcutId");
            int i3 = Build.VERSION.SDK_INT;
            if (i3 >= 25) {
                List c2 = kotlin.collections.x.c("free_session");
                if (i3 >= 25) {
                    V1.e.g(V1.e.c(getSystemService(V1.e.d())), c2);
                }
                V1.g.y(this).getClass();
                Iterator it = ((ArrayList) V1.g.x(this)).iterator();
                if (it.hasNext()) {
                    Ii.b.w(it.next());
                    throw null;
                }
                return;
            }
            return;
        }
        Intrinsics.checkNotNullParameter(this, LogCategory.CONTEXT);
        Intrinsics.checkNotNullParameter("free_session", "shortcutId");
        Intrinsics.checkNotNullParameter("60 minutes FREE", "shortLabel");
        Intrinsics.checkNotNullParameter("60 minutes FREE", "longLabel");
        int i4 = Build.VERSION.SDK_INT;
        String str = vJudY.dcqCvKRHV;
        if (i4 >= 25) {
            List e = V1.e.e(V1.e.c(getSystemService(V1.e.d())));
            arrayList = new ArrayList(e.size());
            Iterator it2 = e.iterator();
            while (it2.hasNext()) {
                V1.c cVar = (V1.c) new qg.j(this, V1.e.b(it2.next())).b;
                if (TextUtils.isEmpty(cVar.e)) {
                    throw new IllegalArgumentException(str);
                }
                Intent[] intentArr = cVar.c;
                if (intentArr == null || intentArr.length == 0) {
                    throw new IllegalArgumentException("Shortcut must have an intent");
                }
                arrayList.add(cVar);
            }
        } else {
            try {
                V1.g.y(this).getClass();
                arrayList = new ArrayList();
            } catch (Exception unused) {
                arrayList = new ArrayList();
            }
        }
        Intrinsics.checkNotNullExpressionValue(arrayList, "getDynamicShortcuts(...)");
        if (!arrayList.isEmpty()) {
            Iterator it3 = arrayList.iterator();
            while (it3.hasNext()) {
                if (Intrinsics.c(((V1.c) it3.next()).b, "free_session")) {
                    return;
                }
            }
        }
        V1.c cVar2 = new V1.c();
        cVar2.a = this;
        cVar2.b = "free_session";
        cVar2.e = "60 minutes FREE";
        cVar2.f = "60 minutes FREE";
        cVar2.h = IconCompat.d(this, 2131231807);
        Intent intent = new Intent((Context) this, (Class<?>) MasterActivity.class);
        intent.setAction("android.intent.action.VIEW");
        intent.setFlags(32768);
        intent.putExtra("shortcut_id", "free_session");
        Unit unit = Unit.a;
        cVar2.c = new Intent[]{intent};
        if (TextUtils.isEmpty(cVar2.e)) {
            throw new IllegalArgumentException(str);
        }
        Intent[] intentArr2 = cVar2.c;
        if (intentArr2 == null || intentArr2.length == 0) {
            throw new IllegalArgumentException("Shortcut must have an intent");
        }
        Intrinsics.checkNotNullExpressionValue(cVar2, "build(...)");
        int i5 = Build.VERSION.SDK_INT;
        int a = i5 >= 25 ? V1.e.a(V1.e.c(getSystemService(V1.e.d()))) : 5;
        if (a == 0) {
            return;
        }
        if (i5 <= 29 && (iconCompat = cVar2.h) != null && (((i = iconCompat.a) == 6 || i == 4) && (i2 = iconCompat.i(this)) != null && (decodeStream = BitmapFactory.decodeStream(i2)) != null)) {
            if (i == 6) {
                c = new IconCompat(5);
                c.b = decodeStream;
            } else {
                c = IconCompat.c(decodeStream);
            }
            cVar2.h = c;
        }
        if (i5 >= 30) {
            V1.e.c(getSystemService(V1.e.d())).pushDynamicShortcut(cVar2.a());
        } else if (i5 >= 25) {
            ShortcutManager c3 = V1.e.c(getSystemService(V1.e.d()));
            if (V1.e.i(c3)) {
                return;
            }
            List e2 = V1.e.e(c3);
            if (e2.size() >= a) {
                V1.e.g(c3, Arrays.asList(V1.f.a(e2)));
            }
            V1.e.k(c3, Arrays.asList(cVar2.a()));
        }
        try {
            V1.g.y(this).getClass();
            ArrayList arrayList2 = new ArrayList();
            if (arrayList2.size() >= a) {
                Iterator it4 = arrayList2.iterator();
                int i6 = -1;
                String str2 = null;
                while (it4.hasNext()) {
                    V1.c cVar3 = (V1.c) it4.next();
                    int i7 = cVar3.l;
                    if (i7 > i6) {
                        str2 = cVar3.b;
                        i6 = i7;
                    }
                }
                Arrays.asList(str2);
            }
            Arrays.asList(cVar2);
            Iterator it5 = ((ArrayList) V1.g.x(this)).iterator();
            if (it5.hasNext()) {
                if (it5.next() != null) {
                    throw new ClassCastException();
                }
                Collections.singletonList(cVar2);
                throw null;
            }
        } catch (Exception unused2) {
            Iterator it6 = ((ArrayList) V1.g.x(this)).iterator();
            if (it6.hasNext()) {
                if (it6.next() != null) {
                    throw new ClassCastException();
                }
                Collections.singletonList(cVar2);
                throw null;
            }
        } catch (Throwable th) {
            Iterator it7 = ((ArrayList) V1.g.x(this)).iterator();
            if (!it7.hasNext()) {
                V1.g.J(this, cVar2.b);
                throw th;
            }
            if (it7.next() != null) {
                throw new ClassCastException();
            }
            Collections.singletonList(cVar2);
            throw null;
        }
        V1.g.J(this, cVar2.b);
    }

    public final void initFirebaseCrashlytics() {
        yc.e a;
        try {
            oc.g.d();
        } catch (Exception unused) {
            oc.g.h(this);
        }
        Ai.p pVar = KukuFMApplication.x;
        User t = io.sentry.config.d.t(pVar);
        if (t == null || (a = pVar.B().e().a()) == null) {
            return;
        }
        Bc.c a2 = Bc.c.a();
        String valueOf = String.valueOf(t.getId());
        Fc.s sVar = a2.a;
        sVar.o.a.b(new A3.N(6, sVar, valueOf));
        Bc.c a3 = Bc.c.a();
        HashMap hashMap = new HashMap();
        hashMap.put("is_premium", Boolean.toString(t.isPremium()));
        hashMap.put("firebase_uid", a.b.a);
        hashMap.put("sign_in_provider", String.valueOf(t.getFirebaseSignInProvider()));
        Fc.s sVar2 = a3.a;
        if (hashMap.isEmpty()) {
            return;
        }
        sVar2.o.a.b(new A3.N(7, sVar2, hashMap));
    }

    public final void initGamificationFeature() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new O(this, null), 3);
    }

    public final void initGoalFeature() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new T(this, null), 3);
    }

    public final void initLocks() {
        if (this.mWakeLock == null) {
            Object systemService = getSystemService("power");
            Intrinsics.f(systemService, "null cannot be cast to non-null type android.os.PowerManager");
            PowerManager powerManager = (PowerManager) systemService;
            PowerManager.WakeLock newWakeLock = powerManager.newWakeLock(1, powerManager.toString());
            newWakeLock.acquire();
            this.mWakeLock = newWakeLock;
        }
        if (this.mWifiLock == null) {
            Object systemService2 = KukuFMApplication.x.B().getApplicationContext().getSystemService("wifi");
            Intrinsics.f(systemService2, "null cannot be cast to non-null type android.net.wifi.WifiManager");
            WifiManager.WifiLock createWifiLock = ((WifiManager) systemService2).createWifiLock(3, toString());
            WifiManager.WifiLock wifiLock = this.mWifiLock;
            if (wifiLock != null) {
                wifiLock.acquire();
            }
            this.mWifiLock = createWifiLock;
        }
    }

    private final void initMLPopup(MlPopupData mlPopupData, Calendar calendar) {
        Vk.w0 mMasterViewModel = getMMasterViewModel();
        mMasterViewModel.getClass();
        Intrinsics.checkNotNullParameter(mlPopupData, "mlPopupData");
        mMasterViewModel.f.setValue(mMasterViewModel.l().copy("Want to listen more?", mlPopupData.getHeading(), mlPopupData.getTimeLeft(), mlPopupData.getCtaText(), "No thanks, I’ll buy episodes!", mlPopupData.getShowId(), mlPopupData.getShowSlug(), mlPopupData.getType() == 0 ? Wk.g.FREE : Wk.g.PERCENT_DISCOUNT, true));
        uj.d h = KukuFMApplication.x.B().h();
        Intrinsics.checkNotNullParameter(calendar, "calendar");
        long time = calendar.getTime().getTime();
        SharedPreferences.Editor edit = h.a.a.edit();
        edit.putLong("ml_popup_shown_date", time);
        edit.apply();
        ComposeView composeView = getMBinding().m0;
        composeView.setViewCompositionStrategy(T0.e0.f);
        composeView.setContent(new p0.c(new U(this, 0), true, 620281255));
    }

    public final void initMediaViewModel() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new X(this, null), 3);
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new Z(this, null), 3);
        Object systemService = getSystemService("audio");
        Intrinsics.f(systemService, "null cannot be cast to non-null type android.media.AudioManager");
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1310b0(this, (AudioManager) systemService, null), 3);
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1318d0(this, null), 3);
    }

    public final void initMlPopupCondition(MasterConfig masterConfig) {
        UserResponse userResponse;
        User user;
        MlPopupData mlPopupData;
        if (masterConfig == null || (userResponse = masterConfig.getUserResponse()) == null || (user = userResponse.getUser()) == null || (mlPopupData = user.getMlPopupData()) == null) {
            return;
        }
        long j = KukuFMApplication.x.B().h().a.a.getLong("ml_popup_shown_date", -1L);
        Calendar calendar = Calendar.getInstance();
        Intrinsics.checkNotNullExpressionValue(calendar, "getInstance(...)");
        calendar.setTime(new Date(j));
        Calendar calendar2 = Calendar.getInstance();
        calendar2.setTime(new Date());
        boolean z = false;
        if (calendar.get(0) == calendar2.get(0) && calendar.get(1) == calendar2.get(1) && calendar.get(6) == calendar2.get(6)) {
            z = true;
        }
        if (z) {
            return;
        }
        initMLPopup(mlPopupData, calendar2);
    }

    public final void initMoEngageFeatures() {
        pg.a aVar;
        pg.a aVar2 = pg.a.b;
        if (aVar2 == null) {
            synchronized (pg.a.class) {
                try {
                    aVar = pg.a.b;
                    if (aVar == null) {
                        aVar = new pg.a(0);
                    }
                    pg.a.b = aVar;
                } catch (Throwable th) {
                    throw th;
                }
            }
            aVar2 = aVar;
        }
        Intrinsics.checkNotNullParameter(this, LogCategory.CONTEXT);
        nf.F f = Je.t.c;
        if (f == null) {
            yd.c cVar = mf.h.c;
            Ai.p.P(0, (Throwable) null, (qg.e0) null, new Jh.o(aVar2, 23), 7);
        } else {
            qg.H.b(f).r(this);
        }
        addMoEngageInAppPopupEventsAndCustomHandling();
    }

    public final void initMoreLikeThis() {
        initMoreLikeThisDataObserver();
        initOneMinuteMoreLikeThisObserver();
    }

    private final void initMoreLikeThisDataObserver() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1326f0(this, null), 3);
    }

    public final void initNotificationPrompt(Boolean bool) {
        if (Intrinsics.c(bool, Boolean.TRUE)) {
            Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1330g0(this, null), 3);
        }
    }

    private final void initOneMinuteMoreLikeThisObserver() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1342j0(this, null), 3);
    }

    public final void initPartnershipFeature() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1346k0(this, null), 3);
    }

    public final void initPaymentPendingLayout() {
        AbstractC0493m mBinding = getMBinding();
        Ai.p pVar = KukuFMApplication.x;
        User t = io.sentry.config.d.t(pVar);
        if (t != null && !t.isPremium()) {
            String string = pVar.B().h().a.a.getString("payment_pending_message", "");
            if (string == null) {
                string = "";
            }
            if (string.length() > 0 && pVar.B().h().a.a.getBoolean("payment_pending_dismissed", false)) {
                mBinding.y0.setVisibility(0);
                String string2 = pVar.B().h().a.a.getString("payment_pending_message", "");
                mBinding.z0.setText(string2 != null ? string2 : "");
                ArrayList arrayList = Qn.e.a;
                mBinding.A0.setText(Qn.e.w(2132018741, this, pVar.B().h().e().getCode(), (String) null));
                AppCompatImageView appCompatImageView = mBinding.C0;
                Intrinsics.checkNotNullExpressionValue(appCompatImageView, "pendingNudgeCancelIv");
                Kp.K.Y(appCompatImageView, new co.l(mBinding, 10));
            }
        }
        pVar.B().h().e0("");
        mBinding.y0.setVisibility(8);
        AppCompatImageView appCompatImageView2 = mBinding.C0;
        Intrinsics.checkNotNullExpressionValue(appCompatImageView2, "pendingNudgeCancelIv");
        Kp.K.Y(appCompatImageView2, new co.l(mBinding, 10));
    }

    public static final Unit initPaymentPendingLayout$lambda$65$lambda$64(AbstractC0493m abstractC0493m, View view) {
        Intrinsics.checkNotNullParameter(view, "it");
        Ai.o.C(KukuFMApplication.x.B().h().a.a, "payment_pending_dismissed", true);
        abstractC0493m.y0.setVisibility(8);
        return Unit.a;
    }

    public final void initPopupsFeature() {
        throw new UnsupportedOperationException("Method not decompiled: com.vlv.aravali.master.ui.MasterActivity.initPopupsFeature():void");
    }

    public final void initReels() {
        ComposeView composeView = getMBinding().n0;
        composeView.setViewCompositionStrategy(T0.e0.f);
        composeView.setContent(new p0.c(new U(this, 2), true, 1396434342));
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1358n0(this, null), 3);
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1370q0(this, null), 3);
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1381t0(this, null), 3);
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1393w0(this, null), 3);
    }

    public final void initRemainingHomeFeatures(MasterConfig masterConfig) {
        getIntentExtras();
        hideLoader();
        toggleOfflinePopup(Ai.o.D(KukuFMApplication.x));
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1397x0(masterConfig, this, null), 3);
    }

    public final void initRxCallbacks() {
        ol.a aVar = this.mAppDisposable;
        Qo.b subscribe = nl.a.a(RxEvent.NetworkConnectivity.class).observeOn(Po.b.a()).subscribe(new com.vlv.aravali.downloadsV2.ui.f(new C1305a(this, 1), 8), new com.vlv.aravali.downloadsV2.ui.f(new com.vlv.aravali.coins.ui.fragments.F1(7), 9));
        Intrinsics.checkNotNullExpressionValue(subscribe, "subscribe(...)");
        aVar.a(subscribe);
        ol.a aVar2 = this.mAppDisposable;
        Qo.b subscribe2 = nl.a.a(C2198b.class).subscribe(new com.vlv.aravali.downloadsV2.ui.f(new C1305a(this, 2), 10), new com.vlv.aravali.downloadsV2.ui.f(new com.vlv.aravali.coins.ui.fragments.F1(8), 11));
        Intrinsics.checkNotNullExpressionValue(subscribe2, "subscribe(...)");
        aVar2.a(subscribe2);
        ol.a aVar3 = this.mAppDisposable;
        Qo.b subscribe3 = nl.a.a(RxEvent$ActivityResult.class).subscribe(new com.vlv.aravali.downloadsV2.ui.f(new C1305a(this, 3), 12));
        Intrinsics.checkNotNullExpressionValue(subscribe3, "subscribe(...)");
        aVar3.a(subscribe3);
    }

    public static final Unit initRxCallbacks$lambda$12(MasterActivity masterActivity, RxEvent.NetworkConnectivity networkConnectivity) {
        if (!masterActivity.isFinishing()) {
            if (networkConnectivity.isConnected()) {
                masterActivity.toggleOfflinePopup(true);
            } else {
                masterActivity.toggleOfflinePopup(false);
            }
        }
        return Unit.a;
    }

    public static final Unit initRxCallbacks$lambda$14(Throwable th) {
        th.printStackTrace();
        return Unit.a;
    }

    public static final Unit initRxCallbacks$lambda$16(MasterActivity masterActivity, C2198b c2198b) {
        Kp.p.w(androidx.lifecycle.i0.i(masterActivity), (CoroutineContext) null, (Kp.J) null, new P0(masterActivity, c2198b, null), 3);
        return Unit.a;
    }

    public static final Unit initRxCallbacks$lambda$18(Throwable th) {
        th.printStackTrace();
        return Unit.a;
    }

    public static final Unit initRxCallbacks$lambda$20(MasterActivity masterActivity, RxEvent$ActivityResult rxEvent$ActivityResult) {
        Pk.l lVar;
        if (rxEvent$ActivityResult.getResultCode() != -1 && rxEvent$ActivityResult.getRequestCode() == 1108 && Ai.o.D(KukuFMApplication.x) && (lVar = masterActivity.mInAppUpdateManager) != null) {
            lVar.a(masterActivity.mAppUpdateType);
        }
        return Unit.a;
    }

    private final void initSaleBadge() {
        throw new UnsupportedOperationException("Method not decompiled: com.vlv.aravali.master.ui.MasterActivity.initSaleBadge():void");
    }

    public final void initSaleFeature() {
        initSaleRibbon();
        initSaleBadge();
    }

    private final void initSaleRibbon() {
        UserResponse.DiscountRibbonData discountRibbonData;
        String message;
        UserResponse.DiscountRibbonData discountRibbonData2;
        User t;
        UserResponse userResponse = getUserResponse();
        if (userResponse == null || (discountRibbonData = userResponse.getDiscountRibbonData()) == null || (message = discountRibbonData.getMessage()) == null || !(!StringsKt.H(message))) {
            return;
        }
        Ai.p pVar = KukuFMApplication.x;
        if (!pVar.B().h().D() || ((t = io.sentry.config.d.t(pVar)) != null && t.getShowStickyRibbon())) {
            UserResponse userResponse2 = getUserResponse();
            this.mRibbonSaleMessage = (userResponse2 == null || (discountRibbonData2 = userResponse2.getDiscountRibbonData()) == null) ? null : discountRibbonData2.getMessage();
            UserResponse userResponse3 = getUserResponse();
            setUnsetSaleRibbon(true, userResponse3 != null ? userResponse3.getDiscountRibbonData() : null);
            ConstraintLayout constraintLayout = getMBinding().o0;
            Intrinsics.checkNotNullExpressionValue(constraintLayout, "discountRibbonFl");
            Kp.K.Y(constraintLayout, new C1305a(this, 0));
        }
    }

    public static final Unit initSaleRibbon$lambda$34(MasterActivity masterActivity, View view) {
        UserResponse.DiscountRibbonData discountRibbonData;
        Intrinsics.checkNotNullParameter(view, "it");
        masterActivity.hideRibbonExtraData();
        try {
            if (Pk.j.a("should_pre_apply_coupon_via_discount_discovery")) {
                ArrayList arrayList = Qn.e.a;
                UserResponse userResponse = masterActivity.getUserResponse();
                Qn.e.c = Uri.parse((userResponse == null || (discountRibbonData = userResponse.getDiscountRibbonData()) == null) ? null : discountRibbonData.getDeeplink());
            } else {
                ArrayList arrayList2 = Qn.e.a;
                Qn.e.c = Uri.parse("app://kukufm/subscription");
            }
            navigateToPremiumTab$default(masterActivity, null, 1, null);
        } catch (Exception unused) {
            xq.d.a.d("Uri parse exception", new Object[0]);
        }
        androidx.datastore.preferences.protobuf.o.r(KukuFMApplication.x, "discount_ribbon_clicked");
        return Unit.a;
    }

    public final void initShortTasks(MasterConfig masterConfig) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new U0(masterConfig, this, null), 3);
    }

    public final Object initStandaloneFeatures(pp.c<? super Unit> cVar) {
        Sp.f fVar = Kp.V.a;
        Object C = Kp.p.C(Sp.e.c, new V0(this, null), cVar);
        return C == qp.a.COROUTINE_SUSPENDED ? C : Unit.a;
    }

    public final Object initThirdPartyAppChecks(pp.c<? super Unit> cVar) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new W0(this, null), 3);
        return Unit.a;
    }

    public final void initUdc() {
    }

    public final void initUpdateManager(Boolean bool) {
        q5.k kVar;
        Pk.l lVar;
        if (Intrinsics.c(bool, Boolean.TRUE)) {
            Pk.l lVar2 = new Pk.l(this, new Z2.i(this, 16));
            this.mInAppUpdateManager = lVar2;
            synchronized (Ob.b.class) {
                try {
                    if (Ob.b.a == null) {
                        Context applicationContext = getApplicationContext();
                        if (applicationContext == null) {
                            applicationContext = this;
                        }
                        Ob.b.a = new q5.k(new Ob.e(applicationContext));
                    }
                    kVar = Ob.b.a;
                } catch (Throwable th) {
                    throw th;
                }
            }
            Ob.d dVar = (Ob.d) ((Pb.c) kVar.b).zza();
            lVar2.c = dVar;
            if (dVar != null) {
                dVar.b(lVar2);
            }
            if (Ai.o.D(KukuFMApplication.x) && (lVar = this.mInAppUpdateManager) != null) {
                lVar.a(this.mAppUpdateType);
            }
            getMBinding().T0.setOnClickListener(new ViewOnClickListenerC1313c(this, 0));
        }
    }

    public static final void initUpdateManager$lambda$43(MasterActivity masterActivity, View view) {
        Ob.d dVar;
        Task a;
        androidx.datastore.preferences.protobuf.o.r(KukuFMApplication.x, "update_popup_clicked");
        Pk.l lVar = masterActivity.mInAppUpdateManager;
        if (lVar != null) {
            int i = masterActivity.mAppUpdateType;
            if (lVar.d != null && (dVar = lVar.c) != null && (a = dVar.a()) != null) {
                a.addOnSuccessListener(new A1.T(new Pk.k(lVar, i), 26));
            }
        }
        masterActivity.getMBinding().T0.setVisibility(8);
    }

    public final void initViewModelObservers() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new Z0(this, null), 3);
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1311b1(this, null), 3);
        observeDeleteEventsList();
        observeCoachMarkDataForAllScreen();
    }

    public final void initializeJuspay() {
        Cl.p.b(this);
    }

    public static final Unit initializeNavController$lambda$23(NavHostFragment navHostFragment) {
        Object obj;
        try {
            List f = navHostFragment.getChildFragmentManager().c.f();
            Intrinsics.checkNotNullExpressionValue(f, "getFragments(...)");
            Iterator it = f.iterator();
            while (true) {
                if (!it.hasNext()) {
                    obj = null;
                    break;
                }
                obj = it.next();
                Fragment fragment = (Fragment) obj;
                if (fragment.isAdded() && !fragment.isDetached()) {
                    break;
                }
            }
            com.vlv.aravali.homeV3.ui.j1 j1Var = (Fragment) obj;
            if (j1Var instanceof com.vlv.aravali.homeV3.ui.j1) {
                j1Var.refreshContent();
            }
        } catch (Exception e) {
            xq.d.a.c(e, "Error refreshing HomeFeedFragment", new Object[0]);
        }
        return Unit.a;
    }

    public final void initializeReviewManager() {
        this.mReviewManager = com.paytm.pgsdk.g.o(this);
    }

    public final Object isEventPresentTodayOrInNextDays(long j, pp.c<? super Boolean> cVar) {
        Sp.f fVar = Kp.V.a;
        return Kp.p.C(Sp.e.c, new C1315c1(this, j, null), cVar);
    }

    public final boolean isInviteNudgeShownToday() {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(new Date());
        long j = KukuFMApplication.x.B().h().a.a.getLong("invite_nudge_shown_date", -1L);
        Calendar calendar2 = Calendar.getInstance();
        Intrinsics.checkNotNullExpressionValue(calendar2, "getInstance(...)");
        calendar2.setTime(new Date(j));
        return calendar2.get(0) == calendar.get(0) && calendar2.get(1) == calendar.get(1) && calendar2.get(6) == calendar.get(6);
    }

    public final boolean isSubscriptionFragmentVisible() {
        v4.r rVar = this.mNavController;
        if (rVar != null) {
            v4.B g = rVar.b.g();
            return g != null && g.b.a == 2131363104;
        }
        Intrinsics.m("mNavController");
        throw null;
    }

    public final void launchFreeTrialDialog() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1319d1(this, null), 3);
    }

    public final void launchFreeTrialPayment(SubscriptionMeta subscriptionMeta) {
        FreeTrialResponse.FreeTrialData freeTrialData;
        FreeTrialResponse.FreeTrialData.FreeTrialPlan freeTrialPlan;
        User t;
        FreeTrialResponse.FreeTrialData freeTrialData2;
        FreeTrialResponse.FreeTrialData freeTrialData3;
        FreeTrialResponse.FreeTrialData freeTrialData4;
        FreeTrialResponse freeTrialResponse = Qn.e.k;
        PlanDetailItem planDetailItem = null;
        r1 = null;
        List<FreeTrialResponse.FreeTrialData.FreeTrialPlan> list = null;
        planDetailItem = null;
        planDetailItem = null;
        if (((freeTrialResponse == null || (freeTrialData4 = freeTrialResponse.getFreeTrialData()) == null) ? null : freeTrialData4.getFreeTrialEligiblePlans()) != null) {
            FreeTrialResponse freeTrialResponse2 = Qn.e.k;
            List<FreeTrialResponse.FreeTrialData.FreeTrialPlan> freeTrialEligiblePlans = (freeTrialResponse2 == null || (freeTrialData3 = freeTrialResponse2.getFreeTrialData()) == null) ? null : freeTrialData3.getFreeTrialEligiblePlans();
            Intrinsics.e(freeTrialEligiblePlans);
            if (!freeTrialEligiblePlans.isEmpty()) {
                FreeTrialResponse freeTrialResponse3 = Qn.e.k;
                if (freeTrialResponse3 != null && (freeTrialData2 = freeTrialResponse3.getFreeTrialData()) != null) {
                    list = freeTrialData2.getFreeTrialEligiblePlans();
                }
                Intrinsics.e(list);
                FreeTrialResponse.FreeTrialData.FreeTrialPlan freeTrialPlan2 = list.get(0);
                FreeTrialResponse freeTrialResponse4 = Qn.e.k;
                planDetailItem = com.vlv.aravali.common.models.m.a(freeTrialPlan2, freeTrialResponse4 != null && freeTrialResponse4.isRazorpayEnable());
                t = io.sentry.config.d.t(KukuFMApplication.x);
                if (t != null || t.isAnonymous()) {
                }
                Al.l.e(this, planDetailItem, subscriptionMeta);
                return;
            }
        }
        FreeTrialResponse freeTrialResponse5 = Qn.e.k;
        if (freeTrialResponse5 != null && (freeTrialData = freeTrialResponse5.getFreeTrialData()) != null && (freeTrialPlan = freeTrialData.getFreeTrialPlan()) != null) {
            FreeTrialResponse freeTrialResponse6 = Qn.e.k;
            planDetailItem = com.vlv.aravali.common.models.m.a(freeTrialPlan, freeTrialResponse6 != null && freeTrialResponse6.isRazorpayEnable());
        }
        t = io.sentry.config.d.t(KukuFMApplication.x);
        if (t != null) {
        }
    }

    public static final void launchInAppReview$lambda$41$lambda$40(com.vlv.aravali.master.ui.MasterActivity r7, int r8, com.google.android.gms.tasks.Task r9) {
        throw new UnsupportedOperationException("Method not decompiled: com.vlv.aravali.master.ui.MasterActivity.launchInAppReview$lambda$41$lambda$40(com.vlv.aravali.master.ui.MasterActivity, int, com.google.android.gms.tasks.Task):void");
    }

    public static final void launchInAppReview$lambda$41$lambda$40$lambda$39(int i, MasterActivity masterActivity, Task task) {
        String str;
        Intrinsics.checkNotNullParameter(task, "<unused var>");
        try {
            User z = KukuFMApplication.x.B().h().z();
            if (z != null) {
                RatingResponse ratingResponse = z.getRatingResponse();
                if (ratingResponse != null) {
                    str = ratingResponse.getFeedback();
                    if (str == null) {
                    }
                    Ui.d.Companion.getClass();
                    Ui.c.a(i, str).show(masterActivity.getSupportFragmentManager(), Ui.d.TAG);
                }
            }
            str = "";
            Ui.d.Companion.getClass();
            Ui.c.a(i, str).show(masterActivity.getSupportFragmentManager(), Ui.d.TAG);
        } catch (Exception e) {
            Bi.k g = androidx.datastore.preferences.protobuf.o.g(KukuFMApplication.x, "bottom_rating_crash", "source", "flow addOnCompleteListener");
            String message = e.getMessage();
            g.c(message != null ? message : "", "message");
            g.d();
        }
    }

    public static final Np.k mCurrentBackStackDestinationId_delegate$lambda$3(MasterActivity masterActivity) {
        v4.r rVar = masterActivity.mNavController;
        return rVar != null ? new Ki.l(new Np.l0(rVar.b.z), 2) : Np.j.a;
    }

    public static final androidx.lifecycle.q0 mMasterViewModel_delegate$lambda$1() {
        return new ol.i(kotlin.jvm.internal.J.a(Vk.w0.class), new com.vlv.aravali.coins.ui.activities.e(28));
    }

    public static final Vk.w0 mMasterViewModel_delegate$lambda$1$lambda$0() {
        return new Vk.w0(new Vk.Q());
    }

    public final void navigateToChat(String str) {
        if (this.mNavController != null) {
            Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1327f1(this, str, null), 3);
        }
    }

    public final void navigateToCoinFestiveSale(String str) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1331g1(this, str, null), 3);
    }

    public final void navigateToLeaderboard() {
        if (this.mNavController != null) {
            Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1347k1(this, null), 3);
        }
    }

    public final void navigateToLibraryDownloads() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1351l1(this, null), 3);
    }

    public final void navigateToPaymentScreen() {
        if (this.mNavController != null) {
            Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1359n1(this, null), 3);
        }
    }

    public static void navigateToPremiumTab$default(MasterActivity masterActivity, String str, int i, Object obj) {
        if ((i & 1) != 0) {
            str = null;
        }
        masterActivity.navigateToPremiumTab(str);
    }

    public final void navigateToProfileTab() {
        if (this.mNavController != null) {
            Config config = Qn.e.f;
            if (config == null || !config.isGamificationEnabled()) {
                v4.r rVar = this.mNavController;
                if (rVar != null) {
                    I5.g.Y(rVar, 2131364211, (Bundle) null);
                    return;
                } else {
                    Intrinsics.m("mNavController");
                    throw null;
                }
            }
            v4.r rVar2 = this.mNavController;
            if (rVar2 != null) {
                I5.g.Y(rVar2, 2131364212, (Bundle) null);
            } else {
                Intrinsics.m("mNavController");
                throw null;
            }
        }
    }

    public static void navigateToSearch$default(MasterActivity masterActivity, boolean z, int i, Object obj) {
        if ((i & 1) != 0) {
            z = false;
        }
        masterActivity.navigateToSearch(z);
    }

    public final void navigateToShop(SubscriptionMeta subscriptionMeta) {
        androidx.lifecycle.B i = androidx.lifecycle.i0.i(this);
        Sp.f fVar = Kp.V.a;
        Kp.p.w(i, Qp.m.a, (Kp.J) null, new C1371q1(this, subscriptionMeta, null), 2);
    }

    public final void navigateToSubscription(SubscriptionMeta subscriptionMeta) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1374r1(this, subscriptionMeta, null), 3);
    }

    private final void observeCPUAndMemoryUsageEvent() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1382t1(2, null), 3);
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1390v1(2, null), 3);
    }

    private final void observeCoachMarkDataForAllScreen() {
        androidx.lifecycle.B i = androidx.lifecycle.i0.i(this);
        Sp.f fVar = Kp.V.a;
        Kp.p.w(i, Sp.e.c, (Kp.J) null, new C1402y1(this, null), 2);
    }

    private final void observeDeleteEventsList() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new B1(this, null), 3);
    }

    public final void observeQualityMetricEvents() {
        Intrinsics.checkNotNullParameter(this, "<this>");
        int i = getResources().getConfiguration().screenLayout;
        if ((i & 1) != 0) {
            AbstractC0210b.v(KukuFMApplication.x, "device_category", "category", "small");
        } else if ((i & 2) != 0) {
            AbstractC0210b.v(KukuFMApplication.x, "device_category", "category", "medium");
        } else if ((i & 3) != 0) {
            AbstractC0210b.v(KukuFMApplication.x, "device_category", "category", "large");
        } else if ((i & 4) != 0) {
            AbstractC0210b.v(KukuFMApplication.x, "device_category", "category", "x_large");
        } else {
            xq.d.a.k("Unknown", new Object[0]);
        }
        sendTimeOfTheDayEvent();
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1(this, null), 3);
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new D1(this, null), 3);
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new E1(this, null), 3);
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new F1(this, null), 3);
    }

    public final void onChallengeDataSuccess(Challenge challenge) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new G1(challenge, this, null), 3);
    }

    public final void onCoinOfferActivationFailure() {
        getMMasterViewModel().m();
        getMBinding().m0.setVisibility(8);
    }

    public final void onCoinOfferActivationSuccess(int i, String str, Wk.g gVar) {
        if (this.mNavController != null) {
            getMMasterViewModel().m();
            getMBinding().m0.setVisibility(8);
            EventData eventData = new EventData("ML Popup", null, null, null, null, null, null, null, null, false, null, null, false, null, null, null, null, null, null, null, null, null, false, 8388606, null);
            if (D8.i.A0()) {
                List list = Qn.m.a;
                Integer valueOf = Integer.valueOf(i);
                String screenName = eventData.getScreenName();
                String str2 = screenName == null ? "" : screenName;
                String screenName2 = eventData.getScreenName();
                String str3 = screenName2 == null ? "" : screenName2;
                String screenName3 = eventData.getScreenName();
                PlayerBaseActivity.playOrPause$default(this, valueOf, str, str2, str3, screenName3 == null ? "" : screenName3, true, false, true, 64, null);
            } else {
                v4.r rVar = this.mNavController;
                if (rVar == null) {
                    Intrinsics.m("mNavController");
                    throw null;
                }
                I5.g.Z(rVar, Integer.valueOf(i), str, false, (String) null, eventData, (Uri) null, (String) null, false, 1992);
            }
            String string = getString(gVar == Wk.g.FREE ? 2132017420 : 2132017419);
            Intrinsics.e(string);
            showToast(string, 1);
            Bi.k r = io.sentry.config.d.r(KukuFMApplication.x, "ml_popup_toast");
            r.c(gVar.toString(), "type");
            r.c(Integer.valueOf(i), "show_id");
            r.c(str, "show_slug");
            r.c(string, "message");
            r.c(Bi.y.a(), "timestamp");
            r.d();
        }
    }

    public final void onCoinRewardAdSuccess(CoinRewardAdsResponse coinRewardAdsResponse, CoinRewardAd coinRewardAd) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new H1(coinRewardAdsResponse, coinRewardAd, this, null), 3);
    }

    public final void onDailyRewardSuccess(CoinsRewardedResponse coinsRewardedResponse) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new L1(coinsRewardedResponse, this, null), 3);
    }

    public final void onFreeTrialSuccess(FreeTrialResponse freeTrialResponse) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new M1(freeTrialResponse, this, null), 3);
    }

    public final void onGenericPopupSuccess(GenericPopupResponse genericPopupResponse, String str) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new N1(str, this, genericPopupResponse, null), 3);
    }

    public final void onGetRatingApiSuccess(RatingFlow ratingFlow) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new O1(ratingFlow, this, null), 3);
    }

    public final void onMasterConfigFailure() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new P1(this, null), 3);
    }

    public final void onMasterConfigSuccess(MasterConfig masterConfig) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new Q1(masterConfig, this, null), 3);
    }

    public final void onPartnershipSuccess(PartnershipData partnershipData) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new S1(partnershipData, this, null), 3);
    }

    public final void onUserAuthenticationFailure() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new U1(this, null), 3);
    }

    public final void onUserAuthenticationSuccess() {
        androidx.datastore.preferences.protobuf.o.r(KukuFMApplication.x, "master_config_started");
        Vk.w0 mMasterViewModel = getMMasterViewModel();
        mMasterViewModel.getClass();
        Kp.p.w(androidx.lifecycle.i0.k(mMasterViewModel), (CoroutineContext) null, (Kp.J) null, new Vk.g0(mMasterViewModel, null), 3);
    }

    public final void openBytesFragment(String str) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new V1(this, str, null), 3);
    }

    public final void openCollection(Uri uri) {
        Integer intOrNull;
        if (this.mNavController != null) {
            Bundle bundle = new Bundle();
            String queryParameter = uri.getQueryParameter("uri");
            if (queryParameter == null) {
                queryParameter = "";
            }
            bundle.putString("uri", queryParameter);
            bundle.putString("slug", uri.getQueryParameter("slug"));
            bundle.putString("title", uri.getQueryParameter("screen_title"));
            String queryParameter2 = uri.getQueryParameter("view_type");
            bundle.putInt("view_type", (queryParameter2 == null || (intOrNull = StringsKt.toIntOrNull(queryParameter2)) == null) ? 0 : intOrNull.intValue());
            bundle.putString("type", uri.getQueryParameter("screen_type"));
            v4.r rVar = this.mNavController;
            if (rVar != null) {
                I5.g.Y(rVar, 2131362560, bundle);
            } else {
                Intrinsics.m("mNavController");
                throw null;
            }
        }
    }

    public final void openCollectionShowsById(String str, String str2) {
        if (this.mNavController != null) {
            Bundle bundle = new Bundle();
            bundle.putString("uri", str);
            bundle.putString("title", str2);
            v4.r rVar = this.mNavController;
            if (rVar != null) {
                I5.g.Y(rVar, 2131362560, bundle);
            } else {
                Intrinsics.m("mNavController");
                throw null;
            }
        }
    }

    private final void openMobileAds(Integer num, String str, Integer num2) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new Y1(num, str, num2, this, null), 3);
    }

    public final void openPaymentScreen() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1308a2(this, null), 3);
    }

    public final void openReelsMoreLikeThis(Show show, MoreLikeThisData moreLikeThisData) {
        Integer id = show.getId();
        if (id != null) {
            int intValue = id.intValue();
            androidx.fragment.app.y U = getSupportFragmentManager().U("more_like_this_dialog");
            if (U != null) {
                androidx.fragment.app.y yVar = U instanceof androidx.fragment.app.y ? U : null;
                if (yVar != null) {
                    yVar.dismiss();
                }
                getReelsViewModel().f(Cm.a.COLLAPSED);
                return;
            }
            com.vlv.aravali.moreLikeThis.ui.f.Companion.getClass();
            com.vlv.aravali.moreLikeThis.ui.f a = com.vlv.aravali.moreLikeThis.ui.c.a(intValue, "Reels_Back", moreLikeThisData);
            a.getLifecycle().a(new C1316c2(this, 0));
            a.show(getSupportFragmentManager(), "more_like_this_dialog");
            Em.v reelsViewModel = getReelsViewModel();
            reelsViewModel.getClass();
            Intrinsics.checkNotNullParameter(show, "show");
            reelsViewModel.r = show;
        }
    }

    public final void openTop20(Uri uri) {
        if (this.mNavController != null) {
            Bundle bundle = new Bundle();
            bundle.putInt("id", 443);
            bundle.putString("slug", uri.getQueryParameter("slug"));
            bundle.putString("uri", uri.getQueryParameter("uri"));
            bundle.putString("title", uri.getQueryParameter("title"));
            bundle.putString("source", "deeplink");
            bundle.putString("screen_type", "top_20_deeplink");
            v4.r rVar = this.mNavController;
            if (rVar != null) {
                I5.g.Y(rVar, 2131364800, bundle);
            } else {
                Intrinsics.m("mNavController");
                throw null;
            }
        }
    }

    public final void openUDC(String str) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1320d2(this, str, null), 3);
    }

    public static void openUDC$default(MasterActivity masterActivity, String str, int i, Object obj) {
        if ((i & 1) != 0) {
            str = null;
        }
        masterActivity.openUDC(str);
    }

    public static void openedViaDeepLink$default(MasterActivity masterActivity, Uri uri, Banner banner, String str, EventData eventData, int i, Object obj) {
        if ((i & 2) != 0) {
            banner = null;
        }
        if ((i & 4) != 0) {
            str = null;
        }
        if ((i & 8) != 0) {
            eventData = null;
        }
        masterActivity.openedViaDeepLink(uri, banner, str, eventData);
    }

    public final Map<String, String> parseQueryParams(String str) {
        List R;
        if (str == null || (R = StringsKt.R(str, new char[]{'&'}, 0, 6)) == null) {
            return kotlin.collections.S.d();
        }
        List list = R;
        int b = kotlin.collections.Q.b(kotlin.collections.z.q(list, 10));
        if (b < 16) {
            b = 16;
        }
        LinkedHashMap linkedHashMap = new LinkedHashMap(b);
        Iterator it = list.iterator();
        while (it.hasNext()) {
            List R2 = StringsKt.R((String) it.next(), new char[]{'='}, 2, 2);
            String str2 = (String) R2.get(0);
            Charset charset = StandardCharsets.UTF_8;
            linkedHashMap.put(URLDecoder.decode(str2, charset.name()), R2.size() > 1 ? URLDecoder.decode((String) R2.get(1), charset.name()) : "");
        }
        return linkedHashMap;
    }

    public final void pushAppLinkToServer(Uri uri) {
        String queryParameter;
        if (uri.getPathSegments().size() > 1) {
            if ((!Intrinsics.c(uri.getPathSegments().get(0), "hashtag") && !Intrinsics.c(uri.getPathSegments().get(0), "genre") && !Intrinsics.c(uri.getPathSegments().get(0), "genres") && !Intrinsics.c(uri.getPathSegments().get(0), "content-type")) || (queryParameter = uri.getQueryParameter("couponCode")) == null || queryParameter.length() == 0) {
                return;
            }
            Vk.w0 mMasterViewModel = getMMasterViewModel();
            String uri2 = uri.toString();
            Intrinsics.checkNotNullExpressionValue(uri2, "toString(...)");
            mMasterViewModel.getClass();
            Intrinsics.checkNotNullParameter(uri2, "urlString");
            Kp.p.w(androidx.lifecycle.i0.k(mMasterViewModel), mMasterViewModel.b, (Kp.J) null, new Vk.m0(mMasterViewModel, uri2, null), 2);
            xq.d.a.a(AbstractC0210b.m(uri, "pushAppLink : "), new Object[0]);
        }
    }

    public static void requestCalendarPermissions$default(MasterActivity masterActivity, Integer num, ReminderResponse reminderResponse, boolean z, int i, Object obj) {
        if ((i & 1) != 0) {
            num = null;
        }
        masterActivity.requestCalendarPermissions(num, reminderResponse, z);
    }

    private final void sendTimeOfTheDayEvent() {
        LocalDate now = LocalDate.now();
        LocalTime now2 = LocalTime.now();
        Bi.k l = KukuFMApplication.x.B().d().l("time_of_day");
        l.c(now, "date");
        l.c(now2, "time");
        l.d();
    }

    private final void setBottomNavigation(List<BottomNavMenuItem> list) {
        ArrayList arrayList;
        List i0;
        BottomNavMenuItem bottomNavMenuItem;
        Integer resourceId;
        NavHostFragment T = getSupportFragmentManager().T(2131363954);
        Intrinsics.f(T, "null cannot be cast to non-null type androidx.navigation.fragment.NavHostFragment");
        v4.r navController = T.getNavController();
        this.mNavController = navController;
        List list2 = Qn.m.a;
        if (navController == null) {
            Intrinsics.m("mNavController");
            throw null;
        }
        v4.E b = ((v4.I) navController.h.getValue()).b(2131820544);
        int i = 2131363937;
        int i2 = 2131363938;
        if (list != null) {
            List<BottomNavMenuItem> list3 = list;
            arrayList = new ArrayList(kotlin.collections.z.q(list3, 10));
            for (BottomNavMenuItem bottomNavMenuItem2 : list3) {
                Intrinsics.checkNotNullParameter(bottomNavMenuItem2, "apiItem");
                String id = bottomNavMenuItem2.getId();
                Pair pair = Intrinsics.c(id, "nav_home") ? new Pair(Integer.valueOf(i2), 2131231214) : Intrinsics.c(id, "nav_new_hot") ? new Pair(2131363941, 2131231217) : Intrinsics.c(id, "nav_premium") ? new Pair(2131363942, 2131231218) : Intrinsics.c(id, "nav_explore") ? Intrinsics.c(bottomNavMenuItem2.getLabel(), "Search") ? new Pair(Integer.valueOf(i), 2131231219) : new Pair(Integer.valueOf(i), 2131231213) : Intrinsics.c(id, "nav_explore") ? new Pair(Integer.valueOf(i), 2131231219) : Intrinsics.c(id, "nav_audio_books") ? new Pair(2131363934, 2131231136) : Intrinsics.c(id, "nav_mySpace") ? new Pair(2131363940, 2131231216) : Intrinsics.c(id, "nav_vip") ? kotlin.text.y.h(bottomNavMenuItem2.getLabel(), "Home", false) ? new Pair(2131363944, 2131231214) : new Pair(2131363944, 2131231221) : Intrinsics.c(id, "nav_store") ? new Pair(2131363943, 2131231220) : Intrinsics.c(id, "nav_chat") ? new Pair(2131363935, 2131231211) : new Pair(0, 0);
                BottomNavMenuItem bottomNavMenuItem3 = new BottomNavMenuItem(bottomNavMenuItem2.getLabel(), bottomNavMenuItem2.getId(), Integer.valueOf(((Number) pair.a).intValue()), Integer.valueOf(((Number) pair.b).intValue()));
                if (Intrinsics.c(bottomNavMenuItem2.getId(), "nav_vip")) {
                    if (C0910a.a == null) {
                        C0910a.a = Boolean.valueOf(KukuFMApplication.x.B().h().p());
                    }
                    Boolean bool = C0910a.a;
                    if (bool != null ? bool.booleanValue() : false) {
                        bottomNavMenuItem3 = BottomNavMenuItem.copy$default(bottomNavMenuItem3, getResources().getString(2132018645), null, null, 2131231214, 6, null);
                    }
                }
                arrayList.add(bottomNavMenuItem3);
                i = 2131363937;
                i2 = 2131363938;
            }
        } else {
            arrayList = null;
        }
        b.g.X((arrayList == null || (bottomNavMenuItem = (BottomNavMenuItem) CollectionsKt.firstOrNull(arrayList)) == null || (resourceId = bottomNavMenuItem.getResourceId()) == null) ? 2131363938 : resourceId.intValue());
        v4.r rVar = this.mNavController;
        if (rVar == null) {
            Intrinsics.m("mNavController");
            throw null;
        }
        Intrinsics.checkNotNullParameter(b, "graph");
        A4.n nVar = rVar.b;
        nVar.getClass();
        Intrinsics.checkNotNullParameter(b, "graph");
        nVar.s(b, (Bundle) null);
        BottomNavigationView bottomNavigationView = getMBinding().Q;
        bottomNavigationView.getMenu().clear();
        if (arrayList != null && (i0 = CollectionsKt.i0(arrayList, 5)) != null) {
            int i3 = 0;
            for (Object obj : i0) {
                int i4 = i3 + 1;
                if (i3 < 0) {
                    kotlin.collections.y.p();
                    throw null;
                }
                BottomNavMenuItem bottomNavMenuItem4 = (BottomNavMenuItem) obj;
                Menu menu = bottomNavigationView.getMenu();
                Integer resourceId2 = bottomNavMenuItem4.getResourceId();
                MenuItem add = menu.add(0, resourceId2 != null ? resourceId2.intValue() : 2131363938, 0, bottomNavMenuItem4.getLabel());
                Integer icon = bottomNavMenuItem4.getIcon();
                add.setIcon(icon != null ? icon.intValue() : 2131231214);
                HashMap<Integer, Integer> hashMap = this.mNavIndexMap;
                Integer resourceId3 = bottomNavMenuItem4.getResourceId();
                hashMap.put(Integer.valueOf(resourceId3 != null ? resourceId3.intValue() : 2131363938), Integer.valueOf(i3));
                i3 = i4;
            }
        }
        bottomNavigationView.setVisibility((arrayList != null ? arrayList.size() : 0) < 2 ? 8 : 0);
        Ai.p pVar = KukuFMApplication.x;
        Pair v = pVar.B().h().v();
        boolean booleanValue = ((Boolean) v.a).booleanValue();
        int intValue = ((Number) v.b).intValue();
        if (booleanValue && intValue > 0 && Pk.j.a("show_download_discovery_indicators")) {
            bottomNavigationView.b(2131363940).k(getColor(2131100610));
        }
        Pair l = pVar.B().h().l();
        boolean booleanValue2 = ((Boolean) l.a).booleanValue();
        int intValue2 = ((Number) l.b).intValue();
        if (Pk.j.a("show_explore_discovery_indicators") && booleanValue2 && intValue2 < 2 && !Qn.e.q.isEmpty()) {
            fb.a b2 = bottomNavigationView.b(2131363937);
            b2.k(getColor(2131100610));
            fb.d dVar = b2.e;
            dVar.a.Y = -10;
            fb.c cVar = dVar.b;
            cVar.Y = -10;
            b2.m();
            dVar.a.i0 = -10;
            cVar.i0 = -10;
            b2.m();
            pVar.B().h().S(intValue2 + 1, booleanValue2);
        }
        Bi.k r = io.sentry.config.d.r(pVar, "nav_button_viewed");
        r.c(String.valueOf(pVar.B().h().g()), "menu");
        r.d();
        ConstraintLayout.LayoutParams layoutParams = getMBinding().N0.getLayoutParams();
        Intrinsics.f(layoutParams, "null cannot be cast to non-null type androidx.constraintlayout.widget.ConstraintLayout.LayoutParams");
        ConstraintLayout.LayoutParams layoutParams2 = layoutParams;
        Integer valueOf = list != null ? Integer.valueOf(list.size()) : null;
        layoutParams2.E = (valueOf != null && valueOf.intValue() == 5) ? 0.275f : (valueOf != null && valueOf.intValue() == 4) ? 0.355f : layoutParams2.E;
    }

    public static void setBottomNavigation$default(MasterActivity masterActivity, List list, int i, Object obj) {
        if ((i & 1) != 0) {
            list = null;
        }
        masterActivity.setBottomNavigation(list);
    }

    private final void setInsets() {
        if (Build.VERSION.SDK_INT < 30) {
            getMBinding().Z.setSystemUiVisibility(1280);
            getMBinding().m0.setSystemUiVisibility(1280);
            getMBinding().n0.setSystemUiVisibility(1280);
            ((x2.m) getMBinding().v0).d.setSystemUiVisibility(1280);
            getMBinding().Z.setFitsSystemWindows(false);
            getMBinding().m0.setFitsSystemWindows(false);
            ((x2.m) getMBinding().v0).d.setFitsSystemWindows(false);
            ConstraintLayout constraintLayout = getMBinding().Z;
            Intrinsics.checkNotNullExpressionValue(constraintLayout, "clMain");
            Ri.r.n(constraintLayout, true);
            ComposeView composeView = getMBinding().m0;
            Intrinsics.checkNotNullExpressionValue(composeView, "composeView");
            Ri.r.n(composeView, true);
            View view = ((x2.m) getMBinding().v0).d;
            Intrinsics.checkNotNullExpressionValue(view, "getRoot(...)");
            Ri.r.n(view, true);
        } else {
            getMBinding().Z.setFitsSystemWindows(true);
            getMBinding().m0.setFitsSystemWindows(true);
            ((x2.m) getMBinding().v0).d.setFitsSystemWindows(true);
        }
        ConstraintLayout constraintLayout2 = getMBinding().Z;
        WeakHashMap weakHashMap = g2.U.a;
        g2.I.c(constraintLayout2);
        g2.I.c(getMBinding().m0);
        g2.I.c(getMBinding().n0);
        g2.I.c(((x2.m) getMBinding().v0).d);
    }

    public static void setUnsetSaleRibbon$default(MasterActivity masterActivity, boolean z, UserResponse.DiscountRibbonData discountRibbonData, int i, Object obj) {
        if ((i & 2) != 0) {
            discountRibbonData = null;
        }
        masterActivity.setUnsetSaleRibbon(z, discountRibbonData);
    }

    public final void setupBackPressHandling() {
        getOnBackPressedDispatcher().a(this, new Am.C(this, 4));
    }

    public final boolean shouldDelayVisibilityForD1User() {
        CUPart cUPart;
        User t = io.sentry.config.d.t(KukuFMApplication.x);
        if (t != null && !t.isPremium() && Intrinsics.c(t.isD0User(), Boolean.FALSE) && (cUPart = (CUPart) getPlayingEpisodeFlow().getValue()) != null) {
            Integer seekPosition = cUPart.getSeekPosition();
            if ((seekPosition != null ? seekPosition.intValue() : 0) > (cUPart.getDurationS() != null ? r0.intValue() : 0) * 0.8d) {
                return true;
            }
        }
        return false;
    }

    private final boolean shouldShowDialog() {
        String str = this.currentFromSource;
        if (str == null) {
            Intrinsics.m("currentFromSource");
            throw null;
        }
        int hashCode = str.hashCode();
        if (hashCode != -1857431251) {
            if (hashCode != -1361203348) {
                if (hashCode != 1315592762 || !str.equals("one_min_inactivity") || KukuFMApplication.x.B().h().a.a.getBoolean("mlt_one_minute_shown", false)) {
                    return false;
                }
            } else if (!str.equals("less_than_ten_perc_content_left")) {
                return false;
            }
        } else if (!str.equals("once_per_session_pause") || KukuFMApplication.x.B().h().a.a.getBoolean("mlt_is_already_shown", false)) {
            return false;
        }
        return true;
    }

    public final boolean shouldTriggerSpecialDeeplinkFlow() {
        if (!KukuFMApplication.x.B().j && getIntent().getData() != null) {
            Uri data = getIntent().getData();
            Intrinsics.checkNotNullParameter(this, LogCategory.CONTEXT);
            if (Intrinsics.c(data != null ? data.getHost() : null, getString(2132017238))) {
                return true;
            }
        }
        return false;
    }

    public final void showBottomNavAndRelatedElements() {
        getMBinding().Q.setVisibility(0);
    }

    public final void showBottomPlayer2() {
        List l = kotlin.collections.y.l(new Integer[]{1, 4});
        s4.x controller = getController();
        if (CollectionsKt.I(l, controller != null ? Integer.valueOf(controller.g()) : null) || getMBinding().D0.getVisibility() == 0) {
            return;
        }
        androidx.lifecycle.B i = androidx.lifecycle.i0.i(this);
        Sp.f fVar = Kp.V.a;
        Kp.p.w(i, Qp.m.a, (Kp.J) null, new C1399x2(this, null), 2);
        if (this.isBottomPlayerViewed) {
            return;
        }
        androidx.datastore.preferences.protobuf.o.r(KukuFMApplication.x, "bottom_player_viewed");
        this.isBottomPlayerViewed = true;
    }

    public final void showCoinPaymentStatus(String str, Pack pack, SubscriptionMeta subscriptionMeta) {
        try {
            Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new D2(str, this, subscriptionMeta, pack, null), 3);
        } catch (Exception unused) {
            xq.d.a.d(" Can not perform this action after onSaveInstanceState", new Object[0]);
        }
    }

    public final void showConfirmationDialog() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new E2(this, null), 3);
    }

    public final void showGamificationLeaderBoardPopup(LeagueLeaderboardResponse.ZoneData zoneData) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new F2(this, zoneData, null), 3);
    }

    public final void showInviteNudgeDialog() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new H2(this, null), 3);
    }

    public final void showLeaderboardIntroPopup() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new I2(this, null), 3);
    }

    public final void showLoader() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new K2(this, null), 3);
    }

    public static void showMobileAdsBottomSheet$default(MasterActivity masterActivity, Integer num, String str, int i, Object obj) {
        if ((i & 1) != 0) {
            num = null;
        }
        masterActivity.showMobileAdsBottomSheet(num, str);
    }

    public final void showRenewalPaymentPendingBottomSheet(boolean z) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new R2(this, null, z), 3);
    }

    public static void showRenewalPaymentPendingBottomSheet$default(MasterActivity masterActivity, boolean z, int i, Object obj) {
        if ((i & 1) != 0) {
            z = true;
        }
        masterActivity.showRenewalPaymentPendingBottomSheet(z);
    }

    public final void showRenewalPromotionDialog(GenericPopupResponse genericPopupResponse) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new S2(genericPopupResponse, this, null), 3);
    }

    public final void showRibbonExtraData() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new U2(this, null), 3);
    }

    private final void showSaleBadge(String str) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new V2(this, str, null), 3);
    }

    public final void showSilentCoinReceivedPopup(CoinSilentNotifData coinSilentNotifData) {
        try {
            String coins = coinSilentNotifData.getCoins();
            if ((coins != null ? Integer.parseInt(coins) : 0) > 0) {
                androidx.lifecycle.B i = androidx.lifecycle.i0.i(this);
                Sp.f fVar = Kp.V.a;
                Kp.p.w(i, Qp.m.a, (Kp.J) null, new W2(this, coinSilentNotifData, null), 2);
            }
        } catch (Exception unused) {
            xq.d.a.d(" Can not perform this action after onSaveInstanceState", new Object[0]);
        }
    }

    public final void showSystemUpgrade(String str) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new X2(this, str, null), 3);
    }

    public final void showUnlockEpisodeBottomSheet(PromoRewardedCoinsInfo promoRewardedCoinsInfo) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new Y2(this, promoRewardedCoinsInfo, null), 3);
    }

    public final void showUnlockWithCoinsBottomSheet(SubscriptionMeta subscriptionMeta) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new Z2(this, subscriptionMeta, null), 3);
    }

    private final void showUpgradePlanBottomSheet() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new a3(this, null), 3);
    }

    public final void showWearAuthenticationDialog(Uri uri) {
        to.f fVar;
        to.f fVar2;
        String queryParameter = uri.getQueryParameter("deviceName");
        to.b bVar = to.f.Companion;
        Bundle m = CredentialProviderBeginSignInController$.ExternalSyntheticOutline0.m("device_name", queryParameter);
        Unit unit = Unit.a;
        bVar.getClass();
        Intrinsics.checkNotNullParameter(m, "bundle");
        to.f fVar3 = new to.f();
        fVar3.setArguments(m);
        this.mWearAuthDialog = fVar3;
        if (fVar3.isAdded() || (fVar = this.mWearAuthDialog) == null || fVar.isVisible() || (fVar2 = this.mWearAuthDialog) == null) {
            return;
        }
        fVar2.show(getSupportFragmentManager(), "");
    }

    public final void startNavratriTrailer(String str, String str2) {
        NavratriSpecialDialogFragment.Companion.getClass();
        Intrinsics.checkNotNullParameter(str2, "deepLink");
        NavratriSpecialDialogFragment navratriSpecialDialogFragment = new NavratriSpecialDialogFragment();
        Bundle bundle = new Bundle();
        bundle.putString("ANIMATION_URL", str);
        bundle.putString("DEEP_LINK", str2);
        navratriSpecialDialogFragment.setArguments(bundle);
        navratriSpecialDialogFragment.show(getSupportFragmentManager(), "Navratri Special");
    }

    private final void toggleOfflinePopup(boolean z) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new e3(this, null, z), 3);
    }

    public final void unlockEpisode(Show show, CUPart cUPart) {
        if (io.sentry.config.d.t(KukuFMApplication.x) == null || this.isUnlockDialogVisible) {
            return;
        }
        com.vlv.aravali.coins.ui.fragments.T0 t0 = UnlockEpisodeBottomSheet.Companion;
        Integer id = show.getId();
        int intValue = id != null ? id.intValue() : 0;
        Integer id2 = cUPart.getId();
        Integer valueOf = Integer.valueOf(id2 != null ? id2.intValue() : 0);
        Offer unlockOffer = show.getUnlockOffer();
        t0.getClass();
        UnlockEpisodeBottomSheet a = com.vlv.aravali.coins.ui.fragments.T0.a("reels", intValue, valueOf, unlockOffer);
        a.registerDialogActionsInterface(new C0896y0(this, 14));
        this.isUnlockDialogVisible = true;
        a.show(getSupportFragmentManager(), UnlockEpisodeBottomSheet.TAG);
    }

    private final void updateStars(float f, String str) {
        Vj.D2 d2;
        AbstractC0493m mBinding = getMBinding();
        if (isFinishing()) {
            return;
        }
        mBinding.F0.setVisibility(8);
        Bi.k r = io.sentry.config.d.r(KukuFMApplication.x, "rating_bottom_bar_rated");
        r.c(Float.valueOf(f), "rating");
        r.d();
        this.mCurrentRating = f;
        int parseColor = Color.parseColor("#FEDB64");
        int parseColor2 = Color.parseColor("#797979");
        int i = 0;
        while (true) {
            d2 = mBinding.H0;
            if (i >= 4) {
                break;
            }
            ImageView imageView = i != 0 ? i != 1 ? i != 2 ? i != 3 ? null : d2.X : d2.Q : d2.M : d2.L;
            if (imageView != null) {
                if (f > i) {
                    imageView.setColorFilter(parseColor, PorterDuff.Mode.SRC_IN);
                } else {
                    imageView.setColorFilter(parseColor2, PorterDuff.Mode.SRC_IN);
                }
            }
            i++;
        }
        if (f >= 5.0f) {
            d2.Y.setAnimation(2131951667);
            d2.Y.e();
        } else {
            d2.Y.setProgress(0.0f);
            LottieAnimationView lottieAnimationView = d2.Y;
            lottieAnimationView.setAnimation(2131951666);
            lottieAnimationView.e();
        }
        if (f >= 3.0f) {
            launchInAppReview((int) f);
            AbstractC0210b.v(KukuFMApplication.x, "rate_us_on_playstore_clicked", "source", "bottom_pop_up");
        } else {
            Ui.d.Companion.getClass();
            Ui.c.a((int) f, str).show(getSupportFragmentManager(), Ui.d.TAG);
        }
    }

    public final void addFragment(Fragment fragment, String str) {
        Intrinsics.checkNotNullParameter(fragment, "fragment");
        Intrinsics.checkNotNullParameter(str, "tag");
        if (fragment.isAdded() || isFinishing()) {
            return;
        }
        List f = fragment.getChildFragmentManager().c.f();
        Intrinsics.checkNotNullExpressionValue(f, "getFragments(...)");
        if (f.isEmpty()) {
            this.mPendingTransactionMap.put(str, new J5.v(this, fragment, str, 17));
            return;
        }
        androidx.fragment.app.j0 childFragmentManager = fragment.getChildFragmentManager();
        Intrinsics.checkNotNullExpressionValue(childFragmentManager, "getChildFragmentManager(...)");
        Intrinsics.checkNotNullParameter(childFragmentManager, "fragmentManager");
        Intrinsics.checkNotNullParameter(fragment, "fragment");
        Intrinsics.checkNotNullParameter(str, "tag");
        childFragmentManager.getClass();
        androidx.fragment.app.a aVar = new androidx.fragment.app.a(childFragmentManager);
        Intrinsics.checkNotNullExpressionValue(aVar, "beginTransaction(...)");
        ((androidx.fragment.app.w0) aVar).h = 4099;
        aVar.f(2131363954, fragment, str, 1);
        aVar.d(str);
        aVar.p(fragment, androidx.lifecycle.v.RESUMED);
        aVar.l(true, true);
    }

    public final void addStoreFragment(String str, SubscriptionMeta subscriptionMeta, boolean z, int i) {
        ArrayList arrayList = Qn.e.a;
        Config config = Qn.e.f;
        if (!(config != null ? Intrinsics.c(config.isWebCoinStoreEnabled(), Boolean.TRUE) : false)) {
            Bundle bundle = new Bundle();
            if (subscriptionMeta != null) {
                bundle.putSerializable("subscription_meta", subscriptionMeta);
            }
            bundle.putBoolean("show_toolbar_back", z);
            bundle.putInt("tab_position", i);
            v4.r rVar = this.mNavController;
            if (rVar != null) {
                if (rVar != null) {
                    I5.g.Y(rVar, 2131363943, bundle);
                    return;
                } else {
                    Intrinsics.m("mNavController");
                    throw null;
                }
            }
            return;
        }
        Bundle bundle2 = new Bundle();
        if (subscriptionMeta != null) {
            bundle2.putSerializable("subscription_meta", subscriptionMeta);
        }
        if (str != null) {
            bundle2.putString("premium_page_url", str);
        }
        bundle2.putBoolean("show_toolbar_back", z);
        bundle2.putBoolean("show_toolbar", true);
        v4.r rVar2 = this.mNavController;
        if (rVar2 != null) {
            if (rVar2 != null) {
                I5.g.Y(rVar2, 2131365583, bundle2);
            } else {
                Intrinsics.m("mNavController");
                throw null;
            }
        }
    }

    public final void displayShowRatingSheet(CUPart cUPart) {
        Integer id;
        Intrinsics.checkNotNullParameter(cUPart, "cuPart");
        if (this.mDisplayShowRatingDialog == null) {
            Show show = (Show) getPlayingShowFlow().getValue();
            Integer durationS = cUPart.getDurationS();
            if (durationS != null) {
                int intValue = durationS.intValue();
                Float valueOf = cUPart.getSeekPosition() != null ? Float.valueOf(r5.intValue() / intValue) : null;
                if ((valueOf != null ? valueOf.floatValue() : 0.0f) <= 0.8f || show == null || (id = show.getId()) == null) {
                    return;
                }
                Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1380t(this, show, id.intValue(), null), 3);
            }
        }
    }

    public final int getBottomMargin() {
        return this.mBottomFloatingHeight;
    }

    public final Integer getCurrentEpisodeIndex() {
        return this.currentEpisodeIndex;
    }

    public final Qn.t getKukuFMChat() {
        Qn.t tVar = this.kukuFMChat;
        if (tVar != null) {
            return tVar;
        }
        Intrinsics.m("kukuFMChat");
        throw null;
    }

    public final float getMCurrentRating() {
        return this.mCurrentRating;
    }

    public final long getMMasterActivityStartTime() {
        return this.mMasterActivityStartTime;
    }

    public final String getMRibbonSaleMessage() {
        return this.mRibbonSaleMessage;
    }

    @Override
    public WebView getPaymentsWebView() {
        WebView webView = getMBinding().B0;
        Intrinsics.checkNotNullExpressionValue(webView, "paymentsWebView");
        return webView;
    }

    public final Integer getTotalEpisodes() {
        return this.totalEpisodes;
    }

    public final UserResponse getUserResponse() {
        return getMMasterViewModel().e;
    }

    public final java.lang.Object handleCalendarEventDeletion(long r9, boolean r11, pp.c<? super kotlin.Unit> r12) {
        throw new UnsupportedOperationException("Method not decompiled: com.vlv.aravali.master.ui.MasterActivity.handleCalendarEventDeletion(long, boolean, pp.c):java.lang.Object");
    }

    public final void hideAllRibbons() {
        AbstractC0493m mBinding = getMBinding();
        mBinding.o0.setVisibility(8);
        mBinding.j0.setVisibility(8);
    }

    public final void hideRating() {
        getMBinding().F0.setVisibility(8);
    }

    public final void hideRibbonExtraData() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new E(this, null), 3);
    }

    public final void initAutoPlayShowFeature(boolean z, MasterConfig.CampaignData campaignData) {
        if (z) {
            Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new I(campaignData, this, null), 3);
        }
    }

    public final boolean isInLast10Percent(Integer num, Integer num2) {
        if (num == null || num2 == null || num.intValue() <= 0) {
            return false;
        }
        return ((double) num2.intValue()) >= ((double) num.intValue()) * 0.9d;
    }

    public final boolean isRatingPopupPending() {
        return this.isRatingPopupPending;
    }

    public final boolean isRatingPopupVisible() {
        ConstraintLayout constraintLayout = getMBinding().F0;
        Intrinsics.checkNotNullExpressionValue(constraintLayout, "ratingBar");
        return constraintLayout.getVisibility() == 0;
    }

    public final void launchInAppReview(int i) {
        X.p pVar = this.mReviewManager;
        if (pVar == null) {
            Toast.makeText((Context) this, (CharSequence) "Review Manager not initiated", 0).show();
            return;
        }
        Task H = pVar.H();
        Intrinsics.checkNotNullExpressionValue(H, "requestReviewFlow(...)");
        H.addOnCompleteListener(new C1309b(this, i));
    }

    public final void navigateToCoinReferral(String str) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1335h1(this, str, null), 3);
    }

    public final void navigateToDownloads() {
        if (this.mNavController != null) {
            Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1339i1(this, null), 3);
        }
    }

    public final void navigateToHome() {
        navigateToNavId(2131363938);
    }

    public final void navigateToInviteTab() {
        if (this.mNavController != null) {
            Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1343j1(this, null), 3);
        }
    }

    public final void navigateToNavId(int i) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1355m1(this, i, null), 3);
    }

    public final void navigateToPremiumTab(String str) {
        if (this.mNavController != null) {
            Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1363o1(this, str, null), 3);
        }
    }

    public final void navigateToSearch(boolean z) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1367p1(this, null, z), 3);
    }

    @Override
    public void onActivityResult(int i, int i2, Intent intent) {
        String str;
        androidx.fragment.app.j0 childFragmentManager;
        List f;
        super.onActivityResult(i, i2, intent);
        NavHostFragment T = getSupportFragmentManager().T(2131363954);
        Fragment fragment = null;
        NavHostFragment navHostFragment = T instanceof NavHostFragment ? T : null;
        if (navHostFragment != null && (childFragmentManager = navHostFragment.getChildFragmentManager()) != null && (f = childFragmentManager.c.f()) != null) {
            fragment = (Fragment) CollectionsKt.V(f);
        }
        androidx.fragment.app.j0 supportFragmentManager = getSupportFragmentManager();
        com.vlv.aravali.renewal.ui.fragments.p0.Companion.getClass();
        str = com.vlv.aravali.renewal.ui.fragments.p0.TAG;
        com.vlv.aravali.renewal.ui.fragments.p0 U = supportFragmentManager.U(str);
        if (U instanceof com.vlv.aravali.renewal.ui.fragments.p0) {
            com.vlv.aravali.renewal.ui.fragments.p0 p0Var = U;
            if (p0Var.isPaymentInProgress()) {
                p0Var.onActivityResult(i, i2, intent);
                return;
            }
        }
        if (fragment instanceof PremiumTabParentFragment) {
            ((PremiumTabParentFragment) fragment).onActivityResult(i, i2, intent);
        } else if (fragment instanceof StoreViewPagerFragment) {
            ((StoreViewPagerFragment) fragment).onActivityResult(i, i2, intent);
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(((x2.m) getMBinding()).d);
        setInsets();
        Intrinsics.checkNotNullParameter(this, "activity");
        Qn.x xVar = new Qn.x(this);
        xVar.b = registerForActivityResult(new L8.n(4), new Qn.v(xVar, 1));
        this.mPermissionHandler = xVar;
        this.mMasterActivityStartTime = System.currentTimeMillis();
        ArrayList arrayList = Qn.e.a;
        Qn.e.O(false, this);
        Ai.p pVar = KukuFMApplication.x;
        Ai.o.C(pVar.B().h().a.a, "is_main_activity_created", true);
        initDebugModeIndicator();
        Kp.p.w(androidx.lifecycle.i0.i(this), Kp.V.a, (Kp.J) null, new J1(this, null), 2);
        pVar.B().e();
        if (!il.f.g()) {
            pVar.B().e();
            if (!il.f.f()) {
                Intent intent = new Intent((Context) this, (Class<?>) SignupActivity.class);
                intent.setFlags(268468224);
                startActivity(intent);
                Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new K1(this, null), 3);
            }
        }
        if (Ai.o.D(pVar)) {
            authenticateUser$default(this, null, 1, null);
        } else {
            onMasterConfigSuccess(null);
        }
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new K1(this, null), 3);
    }

    @Override
    public void onDestroy() {
        Ob.d dVar;
        Bi.k r = io.sentry.config.d.r(KukuFMApplication.x, "app_killed");
        r.c(Boolean.valueOf(((PlaybackState) getPlaybackStateFlow().getValue()).isPlaying()), "is_currently_playing");
        Show show = (Show) getPlayingShowFlow().getValue();
        r.c(show != null ? show.getId() : null, "playing_show_id");
        r.d();
        Qn.e.c = null;
        this.mAppDisposable.b();
        Pk.l lVar = this.mInAppUpdateManager;
        if (lVar != null && (dVar = lVar.c) != null) {
            synchronized (dVar) {
                dVar.b.b(lVar);
            }
        }
        um.m.a.d();
        um.l.e = null;
        um.l.f = null;
        um.l.g = false;
        super.onDestroy();
    }

    @Override
    public void onPause() {
        super.onPause();
        observeCPUAndMemoryUsageEvent();
        if (Zm.i.c()) {
            Zm.i.i();
        }
    }

    @Override
    public void onPictureInPictureModeChanged(boolean z, Configuration configuration) {
        Intrinsics.checkNotNullParameter(configuration, "newConfig");
        super.onPictureInPictureModeChanged(z, configuration);
        if (z) {
            List<androidx.fragment.app.y> f = getSupportFragmentManager().c.f();
            Intrinsics.checkNotNullExpressionValue(f, "getFragments(...)");
            for (androidx.fragment.app.y yVar : f) {
                if (yVar instanceof androidx.fragment.app.y) {
                    yVar.dismissAllowingStateLoss();
                }
            }
        }
    }

    @Override
    public void onResume() {
        super.onResume();
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new T1(this, null), 3);
    }

    public void onStop() {
        WifiManager.WifiLock wifiLock;
        PowerManager.WakeLock wakeLock;
        super.onStop();
        PowerManager.WakeLock wakeLock2 = this.mWakeLock;
        if (wakeLock2 != null && wakeLock2.isHeld() && (wakeLock = this.mWakeLock) != null) {
            wakeLock.release();
        }
        WifiManager.WifiLock wifiLock2 = this.mWifiLock;
        if (wifiLock2 == null || !wifiLock2.isHeld() || (wifiLock = this.mWifiLock) == null) {
            return;
        }
        wifiLock.release();
    }

    public final void openCancelSubscriptionPage() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new W1(this, null), 3);
    }

    public final void openDownloadsPage() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new X1(this, null), 3);
    }

    public final void openMoreLikeThis(String str, int i) {
        Intrinsics.checkNotNullParameter(str, "from");
        this.currentFromSource = str;
        this.currentShowId = i;
        if (Intrinsics.c(str, "less_than_ten_perc_content_left") || (!KukuFMApplication.x.B().h().E() && Intrinsics.c(str, "once_per_session_pause"))) {
            Ai.p pVar = KukuFMApplication.x;
            if (!pVar.B().h().E()) {
                Ai.o.C(pVar.B().h().a.a, "mlt_is_one_time_pause_shown", true);
            }
            pVar.B().h().F(false);
        }
        Vk.w0 mMasterViewModel = getMMasterViewModel();
        mMasterViewModel.getClass();
        Kp.p.w(androidx.lifecycle.i0.k(mMasterViewModel), (CoroutineContext) null, (Kp.J) null, new Vk.a0(mMasterViewModel, i, null), 3);
    }

    public final void openPauseSubscriptionPage() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new Z1(this, null), 3);
    }

    public final void openProfileFragment(int i) {
        if (this.mNavController != null) {
            Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1312b2(this, i, null), 3);
        }
    }

    public final void openedViaDeepLink(Uri uri, Banner banner, String str, EventData eventData) {
        Intrinsics.checkNotNullParameter(uri, "data");
        Bi.k r = io.sentry.config.d.r(KukuFMApplication.x, "deeplink_processing");
        r.c(uri.toString(), "deeplink_url");
        r.d();
        xq.d.a.d(AbstractC0210b.m(uri, "openedViaDeepLink "), new Object[0]);
        new B3.d(this).B(uri, new B4.v(this, str, eventData, uri, banner, 11));
    }

    public final void playReelsShow(Show show) {
        Show show2;
        Intrinsics.checkNotNullParameter(show, "show");
        Integer id = show.getId();
        ReelV2 reelV2 = um.l.e;
        if (Intrinsics.c(id, (reelV2 == null || (show2 = reelV2.getShow()) == null) ? null : show2.getId())) {
            Cp.c cVar = um.l.f;
            if (cVar != null) {
                cVar.h();
            }
        } else {
            um.m.a.d();
            Em.v reelsViewModel = getReelsViewModel();
            reelsViewModel.getClass();
            Intrinsics.checkNotNullParameter(show, "newRootShow");
            Kp.p.w(androidx.lifecycle.i0.k(reelsViewModel), (CoroutineContext) null, (Kp.J) null, new Em.p(reelsViewModel, show, null), 3);
        }
        getReelsViewModel().f(Cm.a.EXPANDED);
        stopAndClearPlayerThings("reels", "auto");
    }

    public final void removeExploreBadge() {
        ViewGroup viewGroup;
        NavigationBarMenuView navigationBarMenuView = ((NavigationBarView) getMBinding().Q).b;
        navigationBarMenuView.getClass();
        NavigationBarMenuView.g(2131363937);
        NavigationBarMenuView.g(2131363937);
        ViewGroup[] viewGroupArr = navigationBarMenuView.f;
        if (viewGroupArr != null) {
            int length = viewGroupArr.length;
            for (int i = 0; i < length; i++) {
                viewGroup = viewGroupArr[i];
                if (viewGroup.getId() == 2131363937) {
                    break;
                }
            }
        }
        viewGroup = null;
        if (viewGroup != null && ((NavigationBarItemView) viewGroup).s0 != null) {
            ImageView imageView = ((NavigationBarItemView) viewGroup).v;
            if (imageView != null) {
                viewGroup.setClipChildren(true);
                viewGroup.setClipToPadding(true);
                com.bumptech.glide.b.B(((NavigationBarItemView) viewGroup).s0, imageView);
            }
            ((NavigationBarItemView) viewGroup).s0 = null;
        }
        navigationBarMenuView.L.put(2131363937, null);
        Ai.p pVar = KukuFMApplication.x;
        Pair l = pVar.B().h().l();
        ((Boolean) l.a).getClass();
        pVar.B().h().S(((Number) l.b).intValue() + 1, false);
    }

    public final void requestCalendarPermissions(Integer num, ReminderResponse reminderResponse, boolean z) {
        Intrinsics.checkNotNullParameter(reminderResponse, "reminderResponse");
        Qn.x xVar = this.mPermissionHandler;
        if (xVar == null) {
            Intrinsics.m("mPermissionHandler");
            throw null;
        }
        B4.W w = new B4.W();
        w.a = z;
        w.b = num;
        w.c = reminderResponse;
        w.d = this;
        xVar.b(new String[]{"android.permission.READ_CALENDAR", "android.permission.WRITE_CALENDAR"}, w);
    }

    public final void restartMasterActivity() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1379s2(this, null), 3);
    }

    public final void setCurrentEpisodeIndex(Integer num) {
        this.currentEpisodeIndex = num;
    }

    public final void setKukuFMChat(Qn.t tVar) {
        Intrinsics.checkNotNullParameter(tVar, "<set-?>");
        this.kukuFMChat = tVar;
    }

    public final void setMCurrentRating(float f) {
        this.mCurrentRating = f;
    }

    public final void setMMasterActivityStartTime(long j) {
        this.mMasterActivityStartTime = j;
    }

    public final void setMRibbonSaleMessage(String str) {
        this.mRibbonSaleMessage = str;
    }

    public final void setRatingPopupPending(boolean z) {
        this.isRatingPopupPending = z;
    }

    public final void setTotalEpisodes(Integer num) {
        this.totalEpisodes = num;
    }

    public final void setUnsetSaleRibbon(boolean z, UserResponse.DiscountRibbonData discountRibbonData) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new C1387u2(this, discountRibbonData, z, null), 3);
    }

    public final boolean shouldShowVipRibbon() {
        return ((Boolean) Kp.p.z(kotlin.coroutines.g.a, new C1391v2(this, null))).booleanValue();
    }

    public final void showFullScreenInvite() {
        navigateToInviteTab();
    }

    public final void showHideDiscountRibbon(boolean z) {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new G2(this, null, z), 3);
    }

    public final void showMobileAdsBottomSheet(Integer num, String str) {
        Intrinsics.checkNotNullParameter(str, "source");
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new N2(this, num, str, null), 3);
    }

    public final void showRatingPopUp() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new O2(this, null), 3);
    }

    public final void showRatingPopUpFiveStar() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new P2(this, null), 3);
    }

    public final void showRatingPopupAgain() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new Q2(this, null), 3);
    }

    public final void showVipBonusRibbon() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new b3(this, null), 3);
    }

    public final void startPlayerActivity(String str, CUPart cUPart, Show show) {
        Intrinsics.checkNotNullParameter(str, "source");
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new d3(show, this, cUPart, str, null), 3);
    }

    public final void updateCoachMarkFrequency(CoachMarkEntity coachMarkEntity) {
        Intrinsics.checkNotNullParameter(coachMarkEntity, "coachMarkEntity");
        Vk.w0 mMasterViewModel = getMMasterViewModel();
        mMasterViewModel.getClass();
        Intrinsics.checkNotNullParameter(coachMarkEntity, "coachMarkEntity");
        V2.a k = androidx.lifecycle.i0.k(mMasterViewModel);
        Sp.f fVar = Kp.V.a;
        Kp.p.w(k, Sp.e.c, (Kp.J) null, new Vk.t0(mMasterViewModel, coachMarkEntity, null), 2);
    }

    public final void updateCurrentPlayingEpisode() {
        Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new f3(this, null), 3);
    }

    public void onNewIntent(Intent intent) {
        String stringExtra;
        Uri data;
        String str;
        Intrinsics.checkNotNullParameter(intent, "intent");
        super/*androidx.activity.ComponentActivity*/.onNewIntent(intent);
        setIntent(intent);
        String stringExtra2 = intent.getStringExtra("type");
        if (stringExtra2 != null && !StringsKt.H(stringExtra2)) {
            if (!Intrinsics.c(intent.getStringExtra("type"), "fully_completed")) {
                return;
            }
            C1518b.Companion.getClass();
            C1518b c1518b = new C1518b();
            androidx.fragment.app.j0 supportFragmentManager = getSupportFragmentManager();
            str = C1518b.TAG;
            c1518b.show(supportFragmentManager, str);
        }
        Tf.d dVar = KukuFMApplication.x.B().h().a;
        int i = dVar.a.getInt("no_of_times_app_opened", 0) + 1;
        SharedPreferences.Editor edit = dVar.a.edit();
        edit.putInt("no_of_times_app_opened", i);
        edit.apply();
        handleShareChooseIntent(intent);
        initAppShortcutFlow();
        if (this.mNavController != null && (data = intent.getData()) != null) {
            if (kotlin.text.y.h(data.getPath(), "/chat", false)) {
                v4.r rVar = this.mNavController;
                if (rVar == null) {
                    Intrinsics.m("mNavController");
                    throw null;
                }
                I5.g.Y(rVar, 2131364493, (Bundle) null);
            } else {
                Bundle bundleExtra = intent.getBundleExtra("notification_tapped");
                String string = bundleExtra != null ? bundleExtra.getString("ct_campaign") : null;
                if (string == null) {
                    string = "deeplink";
                }
                Kp.p.w(androidx.lifecycle.i0.i(this), (CoroutineContext) null, (Kp.J) null, new R1(this, data, intent, new EventData(string, null, null, null, null, null, null, null, null, false, null, null, false, null, null, null, null, null, null, null, null, null, false, 8388606, null), null), 3);
            }
        }
        if (Build.VERSION.SDK_INT >= 31) {
            handleTemplateCTNotifications(intent);
        }
        if (this.mNavController == null || (stringExtra = intent.getStringExtra("navigate_to")) == null) {
            return;
        }
        int hashCode = stringExtra.hashCode();
        if (hashCode == -1540388708) {
            if (stringExtra.equals("navigate_to_wallet_pager_fragment")) {
                Bundle bundle = new Bundle();
                String str2 = gYVEuEOn.rRLZFNlJEL;
                bundle.putInt(str2, intent.getIntExtra(str2, 0));
                v4.r rVar2 = this.mNavController;
                if (rVar2 != null) {
                    I5.g.Y(rVar2, 2131365580, bundle);
                    return;
                } else {
                    Intrinsics.m("mNavController");
                    throw null;
                }
            }
            return;
        }
        if (hashCode == 426385241) {
            if (stringExtra.equals("navigate_to_gift_subscription_fragment")) {
                v4.r rVar3 = this.mNavController;
                if (rVar3 != null) {
                    I5.g.Y(rVar3, 2131363104, (Bundle) null);
                    return;
                } else {
                    Intrinsics.m("mNavController");
                    throw null;
                }
            }
            return;
        }
        if (hashCode == 1952184307 && stringExtra.equals("navigate_to_common_list_fragment")) {
            Bundle bundle2 = new Bundle();
            bundle2.putString("uri", intent.getStringExtra("uri"));
            bundle2.putString("title", intent.getStringExtra("title"));
            bundle2.putString("slug", intent.getStringExtra("slug"));
            bundle2.putParcelable("event_data", intent.getParcelableExtra("event_data"));
            v4.r rVar4 = this.mNavController;
            if (rVar4 != null) {
                I5.g.Y(rVar4, 2131362560, bundle2);
            } else {
                Intrinsics.m("mNavController");
                throw null;
            }
        }
    }

    public final void initializeNavController() {
        final NavHostFragment navHostFragment;
        NavHostFragment T = getSupportFragmentManager().T(2131363954);
        if (T instanceof NavHostFragment) {
            navHostFragment = T;
        } else {
            navHostFragment = null;
        }
        if (navHostFragment == null) {
            xq.d.a.k("NavHostFragment not found or not properly initialized", new Object[0]);
            return;
        }
        v4.r navController = navHostFragment.getNavController();
        this.mNavController = navController;
        if (navController != null) {
            BottomNavigationView bottomNavigationView = getMBinding().Q;
            Intrinsics.checkNotNullExpressionValue(bottomNavigationView, "bottomNavigation");
            final int i = 0;
            Function0 function0 = new Function0() {
                public final Object invoke() {
                    Unit initializeNavController$lambda$23;
                    switch (i) {
                        case 0:
                            initializeNavController$lambda$23 = MasterActivity.initializeNavController$lambda$23(navHostFragment);
                            return initializeNavController$lambda$23;
                        default:
                            return NavHostFragment.h(navHostFragment);
                    }
                }
            };
            Intrinsics.checkNotNullParameter(navController, "<this>");
            Intrinsics.checkNotNullParameter(bottomNavigationView, rpdvnbM.Igz);
            Intrinsics.checkNotNullParameter(function0, "onClick");
            bottomNavigationView.setOnItemSelectedListener(new A3.M(bottomNavigationView, navController, function0, 10));
            Rn.f fVar = new Rn.f(new WeakReference(bottomNavigationView), navController);
            Intrinsics.checkNotNullParameter(fVar, "listener");
            A4.n nVar = navController.b;
            nVar.getClass();
            Intrinsics.checkNotNullParameter(fVar, "listener");
            nVar.p.add(fVar);
            kotlin.collections.r rVar = nVar.f;
            if (!rVar.isEmpty()) {
                v4.m mVar = (v4.m) rVar.last();
                v4.B b = mVar.b;
                mVar.h.c();
                fVar.a(nVar.a, b);
            }
            setBottomNavigation(KukuFMApplication.x.B().h().g());
            return;
        }
        Intrinsics.m("mNavController");
        throw null;
    }
}