package ca.canadapost.module.login;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.accessibility.AccessibilityManager;
import androidx.fragment.app.z;
import androidx.lifecycle.c1;
import androidx.lifecycle.g0;
import androidx.lifecycle.u;
import androidx.navigation.fragment.NavHostFragment;
import ca.canadapost.core.common.customView.h0;
import ca.canadapost.core.common.ui.CpcToolbar;
import ca.canadapost.core.common.ui.ServerErrorDialogFragment;
import ca.canadapost.core.data.model.CoreConstants;
import ca.canadapost.core.data.model.Event;
import ca.canadapost.module.login.LoginActivity;
import ca.canadapost.module.login.signin.LoginResendEmailDialogFragment;
import dn.p;
import dn.r;
import java.util.Set;
import kotlin.Metadata;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import l8.h;
import ld.m;
import ld.n;
import o8.f0;
import rm.c0;
import rm.n0;
import rm.y;
import sm.x0;
import tp.m0;
import tp.w0;
import w8.d0;
import w8.l;
import w8.p0;
import y4.d;

@Metadata(d1 = {"\u0000¬\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000e\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\r\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\u0018\u00002\u00020\u00012\u00020\u00022\u00020\u00032\u00020\u0004B\u0007¢\u0006\u0004\bW\u0010XJ\b\u0010\u0006\u001a\u00020\u0005H\u0002J\b\u0010\u0007\u001a\u00020\u0005H\u0002J\u0012\u0010\n\u001a\u00020\u00052\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0002J\b\u0010\u000b\u001a\u00020\u0005H\u0002J\u0010\u0010\u000e\u001a\u00020\u00052\u0006\u0010\r\u001a\u00020\fH\u0002J\u0010\u0010\u000f\u001a\u00020\u00052\u0006\u0010\r\u001a\u00020\fH\u0002J\b\u0010\u0010\u001a\u00020\u0005H\u0002J\b\u0010\u0012\u001a\u00020\u0011H\u0002J!\u0010\u0019\u001a\u00020\u00052\u0006\u0010\u0014\u001a\u00020\u00132\u0006\u0010\u0016\u001a\u00020\u00152\u0006\u0010\u0018\u001a\u00020\u0017H\u0096\u0001J\u0019\u0010\u001c\u001a\u00020\u00052\u0006\u0010\u0016\u001a\u00020\u00152\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J\u0019\u0010\u001f\u001a\u00020\u00052\u0006\u0010\u001e\u001a\u00020\u001d2\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J\u0010\u0010\"\u001a\u00020\u00052\u0006\u0010!\u001a\u00020 H\u0016J\u0012\u0010%\u001a\u00020\u00052\b\u0010$\u001a\u0004\u0018\u00010#H\u0014J\u0012\u0010&\u001a\u00020\u00052\b\u0010$\u001a\u0004\u0018\u00010#H\u0014J\u0012\u0010'\u001a\u00020\u00052\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0014J\b\u0010(\u001a\u00020\u0011H\u0016J\u000e\u0010*\u001a\b\u0012\u0004\u0012\u00020\u00030)H\u0016J\u0010\u0010-\u001a\u00020\u00052\u0006\u0010,\u001a\u00020+H\u0016J\b\u0010.\u001a\u00020\u0005H\u0014R(\u00106\u001a\b\u0012\u0004\u0012\u00020\u00030/8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b0\u00101\u001a\u0004\b2\u00103\"\u0004\b4\u00105R\"\u0010>\u001a\u0002078\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b8\u00109\u001a\u0004\b:\u0010;\"\u0004\b<\u0010=R\"\u0010F\u001a\u00020?8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b@\u0010A\u001a\u0004\bB\u0010C\"\u0004\bD\u0010ER\u0016\u0010J\u001a\u00020G8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\bH\u0010IR\u0016\u0010N\u001a\u00020K8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\bL\u0010MR\u0016\u0010R\u001a\u00020O8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\bP\u0010QR\u0016\u0010V\u001a\u00020S8\u0002@\u0002X\u0082.¢\u0006\u0006\n\u0004\bT\u0010U¨\u0006Y"}, d2 = {"Lca/canadapost/module/login/LoginActivity;", "Li/c;", "Lnm/e;", "", "Lw8/p0;", "Lrm/n0;", "Y", "j0", "Landroid/content/Intent;", "intent", "d0", "X", "", "token", "c0", "e0", "h0", "", "f0", "Ll8/h;", "spinnerVM", "Landroid/app/Activity;", "activity", "Landroidx/lifecycle/u;", "lifecycleOwner", "W", "Ll8/h$b;", "event", "c", "Landroidx/fragment/app/f;", "fragment", "p", "", "titleId", "setTitle", "Landroid/os/Bundle;", "savedInstanceState", "onCreate", "onPostCreate", "onNewIntent", "L", "Lnm/b;", "a", "Lo8/f0;", "orientation", "i0", "onResume", "Lnm/c;", "s", "Lnm/c;", "Z", "()Lnm/c;", "setDispatchingAndroidInjector", "(Lnm/c;)V", "dispatchingAndroidInjector", "Landroidx/lifecycle/c1$c;", "t", "Landroidx/lifecycle/c1$c;", "b0", "()Landroidx/lifecycle/c1$c;", "setViewModeFactory", "(Landroidx/lifecycle/c1$c;)V", "viewModeFactory", "Lh8/a;", "u", "Lh8/a;", "a0", "()Lh8/a;", "setMaintenanceUtility", "(Lh8/a;)V", "maintenanceUtility", "Lld/n;", "v", "Lld/n;", "sharedViewModel", "Lld/e;", "w", "Lld/e;", "viewModel", "Lod/c;", "x", "Lod/c;", "binding", "Ly4/d;", "y", "Ly4/d;", "appBarConfiguration", "<init>", "()V", "login_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class LoginActivity extends i.c implements nm.e, p0 {

    /* renamed from: r, reason: collision with root package name */
    private final /* synthetic */ l f9919r = new l();

    /* renamed from: s, reason: collision with root package name and from kotlin metadata */
    public nm.c dispatchingAndroidInjector;

    /* renamed from: t, reason: collision with root package name and from kotlin metadata */
    public c1.c viewModeFactory;

    /* renamed from: u, reason: collision with root package name and from kotlin metadata */
    public h8.a maintenanceUtility;

    /* renamed from: v, reason: collision with root package name and from kotlin metadata */
    private n sharedViewModel;

    /* renamed from: w, reason: collision with root package name and from kotlin metadata */
    private ld.e viewModel;

    /* renamed from: x, reason: collision with root package name and from kotlin metadata */
    private od.c binding;

    /* renamed from: y, reason: collision with root package name and from kotlin metadata */
    private y4.d appBarConfiguration;

    /* loaded from: classes4.dex */
    public /* synthetic */ class a {

        /* renamed from: a, reason: collision with root package name */
        public static final /* synthetic */ int[] f9927a;

        static {
            int[] iArr = new int[f0.values().length];
            try {
                iArr[f0.PORTRAIT.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                iArr[f0.LANDSCAPE.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            f9927a = iArr;
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes4.dex */
    public static final class b extends v implements r {
        b() {
            super(4);
        }

        public final void a(String title, String desc, String linkText, String link) {
            t.g(title, "title");
            t.g(desc, "desc");
            t.g(linkText, "linkText");
            t.g(link, "link");
            Bundle bundle = new Bundle();
            bundle.putString(CoreConstants.MAINTENANCE_TITLE, title);
            bundle.putString(CoreConstants.MAINTENANCE_DESC, desc);
            bundle.putString(CoreConstants.MAINTENANCE_LINK_TEXT, linkText);
            bundle.putString(CoreConstants.MAINTENANCE_LINK_URL, link);
            n8.n.f29860a.a(LoginActivity.this, bundle);
        }

        @Override // dn.r
        public /* bridge */ /* synthetic */ Object j(Object obj, Object obj2, Object obj3, Object obj4) {
            a((String) obj, (String) obj2, (String) obj3, (String) obj4);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    public static final class c extends v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        public static final c f9929p = new c();

        public c() {
            super(0);
        }

        @Override // dn.a
        public final Boolean invoke() {
            return Boolean.FALSE;
        }
    }

    /* loaded from: classes4.dex */
    static final class d extends v implements dn.l {
        d() {
            super(1);
        }

        public final void a(Event event) {
            Boolean bool = (Boolean) event.getContentIfNotHandled();
            if (bool != null) {
                LoginActivity loginActivity = LoginActivity.this;
                if (bool.booleanValue()) {
                    loginActivity.j0();
                    n nVar = loginActivity.sharedViewModel;
                    if (nVar == null) {
                        t.y("sharedViewModel");
                        nVar = null;
                    }
                    nVar.W(true);
                }
            }
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Event) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    static final class e extends v implements dn.l {
        e() {
            super(1);
        }

        public final void a(Event event) {
            Boolean bool = (Boolean) event.getContentIfNotHandled();
            if (bool != null) {
                LoginActivity loginActivity = LoginActivity.this;
                if (bool.booleanValue()) {
                    z supportFragmentManager = loginActivity.getSupportFragmentManager();
                    t.f(supportFragmentManager, "getSupportFragmentManager(...)");
                    Bundle bundle = new Bundle();
                    bundle.putBoolean(CoreConstants.EMAIL_TOKEN_EXPIRED, true);
                    LoginResendEmailDialogFragment loginResendEmailDialogFragment = new LoginResendEmailDialogFragment();
                    loginResendEmailDialogFragment.setArguments(bundle);
                    loginResendEmailDialogFragment.show(supportFragmentManager, "LoginResendEmailDialogFragment");
                }
            }
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Event) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    static final class f extends v implements dn.l {
        f() {
            super(1);
        }

        public final void a(Event event) {
            Boolean bool = (Boolean) event.getContentIfNotHandled();
            if (bool != null) {
                LoginActivity loginActivity = LoginActivity.this;
                if (bool.booleanValue()) {
                    z supportFragmentManager = loginActivity.getSupportFragmentManager();
                    t.f(supportFragmentManager, "getSupportFragmentManager(...)");
                    Bundle bundle = new Bundle();
                    ServerErrorDialogFragment serverErrorDialogFragment = new ServerErrorDialogFragment();
                    bundle.putString("error_title", loginActivity.getString(m.f27979e0));
                    bundle.putString("error_message", loginActivity.getString(m.f27978e));
                    bundle.putString("button_text", loginActivity.getString(m.f28010u));
                    serverErrorDialogFragment.setArguments(bundle);
                    serverErrorDialogFragment.show(supportFragmentManager, "ServerErrorDialogFragment");
                }
            }
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Event) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    static final class g extends v implements dn.l {

        /* JADX INFO: Access modifiers changed from: package-private */
        /* loaded from: classes4.dex */
        public static final class a extends kotlin.coroutines.jvm.internal.l implements p {

            /* renamed from: p, reason: collision with root package name */
            int f9934p;

            /* renamed from: q, reason: collision with root package name */
            final /* synthetic */ String f9935q;

            /* renamed from: r, reason: collision with root package name */
            final /* synthetic */ LoginActivity f9936r;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            a(String str, LoginActivity loginActivity, vm.d dVar) {
                super(2, dVar);
                this.f9935q = str;
                this.f9936r = loginActivity;
            }

            @Override // kotlin.coroutines.jvm.internal.a
            public final vm.d create(Object obj, vm.d dVar) {
                return new a(this.f9935q, this.f9936r, dVar);
            }

            @Override // kotlin.coroutines.jvm.internal.a
            public final Object invokeSuspend(Object obj) {
                Object f10;
                f10 = wm.d.f();
                int i10 = this.f9934p;
                if (i10 != 0) {
                    if (i10 == 1) {
                        y.b(obj);
                        return n0.f34904a;
                    }
                    if (i10 != 2) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    y.b(obj);
                    n8.b.f29845a.b(this.f9936r);
                    return n0.f34904a;
                }
                y.b(obj);
                if (this.f9935q != null) {
                    long j10 = this.f9936r.f0() ? 5500L : 3500L;
                    this.f9934p = 2;
                    if (w0.a(j10, this) == f10) {
                        return f10;
                    }
                    n8.b.f29845a.b(this.f9936r);
                    return n0.f34904a;
                }
                ld.e eVar = this.f9936r.viewModel;
                if (eVar == null) {
                    t.y("viewModel");
                    eVar = null;
                }
                g9.l c02 = eVar.c0();
                this.f9934p = 1;
                if (c02.e(this) == f10) {
                    return f10;
                }
                return n0.f34904a;
            }

            @Override // dn.p
            public final Object invoke(m0 m0Var, vm.d dVar) {
                return ((a) create(m0Var, dVar)).invokeSuspend(n0.f34904a);
            }
        }

        g() {
            super(1);
        }

        public final void a(Boolean bool) {
            LoginActivity.this.j0();
            ld.e eVar = LoginActivity.this.viewModel;
            if (eVar == null) {
                t.y("viewModel");
                eVar = null;
            }
            String d10 = eVar.a0().d();
            ld.e eVar2 = LoginActivity.this.viewModel;
            if (eVar2 == null) {
                t.y("viewModel");
                eVar2 = null;
            }
            if (eVar2.Z().h()) {
                tp.k.d(androidx.lifecycle.v.a(LoginActivity.this), null, null, new a(d10, LoginActivity.this, null), 3, null);
            }
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Boolean) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    static final class h extends v implements dn.l {
        h() {
            super(1);
        }

        public final void a(Boolean bool) {
            Bundle bundle = new Bundle();
            LoginActivity loginActivity = LoginActivity.this;
            bundle.putString("error_title", loginActivity.getString(m.P));
            bundle.putString("error_message", loginActivity.getString(m.O));
            bundle.putString("button_text", loginActivity.getString(m.f28008t));
            ServerErrorDialogFragment serverErrorDialogFragment = new ServerErrorDialogFragment();
            serverErrorDialogFragment.setArguments(bundle);
            serverErrorDialogFragment.show(LoginActivity.this.getSupportFragmentManager(), "ErrorDialog");
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Boolean) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    static final class i extends v implements dn.l {
        i() {
            super(1);
        }

        public final void a(Boolean bool) {
            Bundle bundle = new Bundle();
            LoginActivity loginActivity = LoginActivity.this;
            bundle.putString("error_title", loginActivity.getString(m.R));
            bundle.putString("error_message", loginActivity.getString(m.Q));
            bundle.putString("button_text", loginActivity.getString(m.f28008t));
            ServerErrorDialogFragment serverErrorDialogFragment = new ServerErrorDialogFragment();
            serverErrorDialogFragment.setArguments(bundle);
            serverErrorDialogFragment.show(LoginActivity.this.getSupportFragmentManager(), "ErrorDialog");
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Boolean) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    static final class j extends v implements dn.l {
        j() {
            super(1);
        }

        public final void a(Boolean bool) {
            LoginActivity loginActivity = LoginActivity.this;
            int i10 = m.T;
            Bundle a10 = androidx.core.os.c.a(c0.a("error_title", loginActivity.getString(i10)), c0.a("error_message", LoginActivity.this.getString(m.S)), c0.a("button_text", LoginActivity.this.getString(i10)));
            ServerErrorDialogFragment serverErrorDialogFragment = new ServerErrorDialogFragment();
            serverErrorDialogFragment.setArguments(a10);
            serverErrorDialogFragment.show(LoginActivity.this.getSupportFragmentManager(), "ErrorDialog");
        }

        @Override // dn.l
        public /* bridge */ /* synthetic */ Object invoke(Object obj) {
            a((Boolean) obj);
            return n0.f34904a;
        }
    }

    /* loaded from: classes4.dex */
    static final class k implements g0, kotlin.jvm.internal.n {

        /* renamed from: a, reason: collision with root package name */
        private final /* synthetic */ dn.l f9940a;

        k(dn.l function) {
            t.g(function, "function");
            this.f9940a = function;
        }

        @Override // kotlin.jvm.internal.n
        public final rm.i b() {
            return this.f9940a;
        }

        @Override // androidx.lifecycle.g0
        public final /* synthetic */ void d(Object obj) {
            this.f9940a.invoke(obj);
        }

        public final boolean equals(Object obj) {
            if ((obj instanceof g0) && (obj instanceof kotlin.jvm.internal.n)) {
                return t.b(b(), ((kotlin.jvm.internal.n) obj).b());
            }
            return false;
        }

        public final int hashCode() {
            return b().hashCode();
        }
    }

    private final void X() {
        a0().a(true);
        a0().b(new b());
        a0().d();
    }

    private final void Y() {
        androidx.fragment.app.f l02 = getSupportFragmentManager().l0("ErrorDialog");
        ServerErrorDialogFragment serverErrorDialogFragment = l02 instanceof ServerErrorDialogFragment ? (ServerErrorDialogFragment) l02 : null;
        if (serverErrorDialogFragment != null) {
            serverErrorDialogFragment.dismiss();
        }
    }

    private final void c0(String str) {
        tr.a.f36618a.a("Handling Email Verification App link", new Object[0]);
        if (str.length() > 0) {
            ld.e eVar = this.viewModel;
            if (eVar == null) {
                t.y("viewModel");
                eVar = null;
            }
            eVar.l0(str);
        }
    }

    private final void d0(Intent intent) {
        Uri data;
        String queryParameter;
        Uri data2;
        String queryParameter2;
        X();
        Y();
        d9.a.f15931a.i(intent != null ? intent.getData() : null);
        if (intent != null && (data2 = intent.getData()) != null && (queryParameter2 = data2.getQueryParameter("id")) != null) {
            c0(queryParameter2);
        }
        if (intent == null || (data = intent.getData()) == null || (queryParameter = data.getQueryParameter("uuid")) == null) {
            return;
        }
        e0(queryParameter);
    }

    private final void e0(String str) {
        tr.a.f36618a.a("Handling Link Email Verification App link", new Object[0]);
        ld.e eVar = this.viewModel;
        if (eVar == null) {
            t.y("viewModel");
            eVar = null;
        }
        eVar.k0(str);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final boolean f0() {
        Object systemService = getSystemService("accessibility");
        t.e(systemService, "null cannot be cast to non-null type android.view.accessibility.AccessibilityManager");
        return ((AccessibilityManager) systemService).isTouchExplorationEnabled();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void g0(LoginActivity this$0, View view) {
        t.g(this$0, "this$0");
        this$0.onBackPressed();
    }

    private final void h0() {
        i0(f0.PORTRAIT);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void j0() {
        od.c cVar = this.binding;
        od.c cVar2 = null;
        if (cVar == null) {
            t.y("binding");
            cVar = null;
        }
        h0.b(this, cVar.B, getString(m.f28016x), -1, false, false);
        od.c cVar3 = this.binding;
        if (cVar3 == null) {
            t.y("binding");
        } else {
            cVar2 = cVar3;
        }
        cVar2.x().postDelayed(new Runnable() { // from class: ld.c
            @Override // java.lang.Runnable
            public final void run() {
                LoginActivity.k0(LoginActivity.this);
            }
        }, 2500L);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void k0(LoginActivity this$0) {
        t.g(this$0, "this$0");
        od.c cVar = this$0.binding;
        if (cVar == null) {
            t.y("binding");
            cVar = null;
        }
        cVar.x().announceForAccessibility(this$0.getString(m.f28016x));
    }

    @Override // i.c
    public boolean L() {
        v4.j a10 = v4.a.a(this, ld.j.Q);
        y4.d dVar = this.appBarConfiguration;
        if (dVar == null) {
            t.y("appBarConfiguration");
            dVar = null;
        }
        return y4.e.a(a10, dVar) || super.L();
    }

    public void W(l8.h spinnerVM, Activity activity, u lifecycleOwner) {
        t.g(spinnerVM, "spinnerVM");
        t.g(activity, "activity");
        t.g(lifecycleOwner, "lifecycleOwner");
        this.f9919r.a(spinnerVM, activity, lifecycleOwner);
    }

    public final nm.c Z() {
        nm.c cVar = this.dispatchingAndroidInjector;
        if (cVar != null) {
            return cVar;
        }
        t.y("dispatchingAndroidInjector");
        return null;
    }

    @Override // nm.e
    public nm.b a() {
        return Z();
    }

    public final h8.a a0() {
        h8.a aVar = this.maintenanceUtility;
        if (aVar != null) {
            return aVar;
        }
        t.y("maintenanceUtility");
        return null;
    }

    public final c1.c b0() {
        c1.c cVar = this.viewModeFactory;
        if (cVar != null) {
            return cVar;
        }
        t.y("viewModeFactory");
        return null;
    }

    @Override // w8.p0
    public void c(Activity activity, h.b event) {
        t.g(activity, "activity");
        t.g(event, "event");
        this.f9919r.c(activity, event);
    }

    public void i0(f0 orientation) {
        t.g(orientation, "orientation");
        int i10 = a.f9927a[orientation.ordinal()];
        int i11 = 1;
        if (i10 != 1) {
            i11 = 2;
            if (i10 == 2) {
                i11 = 0;
            }
        }
        setRequestedOrientation(i11);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // androidx.fragment.app.k, androidx.activity.h, androidx.core.app.f, android.app.Activity
    public void onCreate(Bundle bundle) {
        Set d10;
        super.onCreate(bundle);
        h0();
        androidx.databinding.n j10 = androidx.databinding.f.j(this, ld.k.f27942b);
        t.f(j10, "setContentView(...)");
        this.binding = (od.c) j10;
        this.viewModel = (ld.e) new c1(this, b0()).a(ld.e.class);
        od.c cVar = this.binding;
        ld.e eVar = null;
        if (cVar == null) {
            t.y("binding");
            cVar = null;
        }
        ld.e eVar2 = this.viewModel;
        if (eVar2 == null) {
            t.y("viewModel");
            eVar2 = null;
        }
        cVar.U(eVar2);
        od.c cVar2 = this.binding;
        if (cVar2 == null) {
            t.y("binding");
            cVar2 = null;
        }
        cVar2.O(this);
        androidx.fragment.app.f k02 = getSupportFragmentManager().k0(ld.j.Q);
        t.e(k02, "null cannot be cast to non-null type androidx.navigation.fragment.NavHostFragment");
        v4.j A = ((NavHostFragment) k02).A();
        int i10 = ld.l.f27968b;
        Intent intent = getIntent();
        A.j0(i10, intent != null ? intent.getBundleExtra(CoreConstants.FRAG_ARGS) : null);
        this.sharedViewModel = (n) new c1(A.y(ld.j.N)).a(n.class);
        d10 = x0.d();
        this.appBarConfiguration = new d.a(d10).c(null).b(new ld.d(c.f9929p)).a();
        od.c cVar3 = this.binding;
        if (cVar3 == null) {
            t.y("binding");
            cVar3 = null;
        }
        CpcToolbar toolbar = cVar3.A.B;
        t.f(toolbar, "toolbar");
        y4.d dVar = this.appBarConfiguration;
        if (dVar == null) {
            t.y("appBarConfiguration");
            dVar = null;
        }
        y4.i.a(toolbar, A, dVar);
        od.c cVar4 = this.binding;
        if (cVar4 == null) {
            t.y("binding");
            cVar4 = null;
        }
        cVar4.A.B.setNavigationOnClickListener(new View.OnClickListener() { // from class: ld.b
            @Override // android.view.View.OnClickListener
            public final void onClick(View view) {
                LoginActivity.g0(LoginActivity.this, view);
            }
        });
        ld.e eVar3 = this.viewModel;
        if (eVar3 == null) {
            t.y("viewModel");
            eVar3 = null;
        }
        W(eVar3, this, this);
        ld.e eVar4 = this.viewModel;
        if (eVar4 == null) {
            t.y("viewModel");
            eVar4 = null;
        }
        eVar4.d0().j(this, new k(new d()));
        ld.e eVar5 = this.viewModel;
        if (eVar5 == null) {
            t.y("viewModel");
            eVar5 = null;
        }
        eVar5.e0().j(this, new k(new e()));
        ld.e eVar6 = this.viewModel;
        if (eVar6 == null) {
            t.y("viewModel");
            eVar6 = null;
        }
        eVar6.j0().j(this, new k(new f()));
        ld.e eVar7 = this.viewModel;
        if (eVar7 == null) {
            t.y("viewModel");
            eVar7 = null;
        }
        eVar7.i0().j(this, new k(new g()));
        ld.e eVar8 = this.viewModel;
        if (eVar8 == null) {
            t.y("viewModel");
            eVar8 = null;
        }
        eVar8.f0().j(this, new k(new h()));
        ld.e eVar9 = this.viewModel;
        if (eVar9 == null) {
            t.y("viewModel");
            eVar9 = null;
        }
        eVar9.g0().j(this, new k(new i()));
        ld.e eVar10 = this.viewModel;
        if (eVar10 == null) {
            t.y("viewModel");
        } else {
            eVar = eVar10;
        }
        eVar.h0().j(this, new k(new j()));
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // androidx.activity.h, android.app.Activity
    public void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        d0(intent);
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // i.c, android.app.Activity
    public void onPostCreate(Bundle bundle) {
        super.onPostCreate(bundle);
        d0(getIntent());
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // androidx.fragment.app.k, android.app.Activity
    public void onResume() {
        super.onResume();
        od.c cVar = this.binding;
        if (cVar == null) {
            t.y("binding");
            cVar = null;
        }
        CpcToolbar toolbar = cVar.A.B;
        t.f(toolbar, "toolbar");
        d0.k(toolbar);
    }

    @Override // w8.p0
    public void p(androidx.fragment.app.f fragment, h.b event) {
        t.g(fragment, "fragment");
        t.g(event, "event");
        this.f9919r.p(fragment, event);
    }

    @Override // android.app.Activity
    public void setTitle(CharSequence titleId) {
        t.g(titleId, "titleId");
        super.setTitle("");
        od.c cVar = this.binding;
        if (cVar == null) {
            t.y("binding");
            cVar = null;
        }
        cVar.A.B.setTitle(titleId);
    }
}
