package ca.canadapost.module.epostprofile.userprofile;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.text.util.Linkify;
import android.util.Patterns;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.appcompat.widget.Toolbar;
import androidx.lifecycle.c1;
import androidx.lifecycle.d1;
import androidx.lifecycle.e1;
import androidx.lifecycle.g0;
import androidx.lifecycle.u;
import androidx.lifecycle.z0;
import ca.canadapost.core.data.model.ResultWrapper;
import ca.canadapost.core.data.model.ValidationError;
import com.google.firebase.messaging.Constants;
import kotlin.Metadata;
import kotlin.jvm.internal.n;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import l8.h;
import ob.j;
import rm.i;
import rm.n0;
import u7.x;
import u8.g;
import w8.k;
import w8.l;
import w8.o;
import w8.p0;
import w8.u0;

@Metadata(d1 = {"\u0000\u0098\u0001\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\n\b\u0007\u0018\u00002\u00020\u00012\b\u0012\u0004\u0012\u00020\u00030\u00022\u00020\u00042\u00020\u0005B\u0007¢\u0006\u0004\bL\u0010MJ5\u0010\u0011\u001a\u00020\u00102\u0006\u0010\u0007\u001a\u00020\u00062\b\u0010\t\u001a\u0004\u0018\u00010\b2\b\u0010\u000b\u001a\u0004\u0018\u00010\n2\u0006\u0010\r\u001a\u00020\f2\u0006\u0010\u000f\u001a\u00020\u000eH\u0096\u0001J\u0019\u0010\u0017\u001a\u00020\u00162\u0006\u0010\u0013\u001a\u00020\u00122\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J\u001b\u0010\u001d\u001a\u00020\u001c2\b\u0010\u0019\u001a\u0004\u0018\u00010\u00182\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J#\u0010 \u001a\u00020\u001c2\u0006\u0010\u001e\u001a\u00020\u001c2\b\u0010\u001f\u001a\u0004\u0018\u00010\u001c2\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J\u001b\u0010!\u001a\u00020\u001c2\b\u0010\u0019\u001a\u0004\u0018\u00010\u00182\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J\u0019\u0010\"\u001a\u00020\u001c2\u0006\u0010\u001e\u001a\u00020\u001c2\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J\u0011\u0010#\u001a\u00020\u001c2\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J\u0011\u0010$\u001a\u00020\u001c2\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J\u0011\u0010%\u001a\u00020\u001c2\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J\u0019\u0010'\u001a\u00020\u00162\u0006\u0010\u0013\u001a\u00020&2\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J\u0019\u0010(\u001a\u00020\u00162\u0006\u0010\u0015\u001a\u00020\u00142\u0006\u0010\u0013\u001a\u00020&H\u0096\u0001J\u0011\u0010)\u001a\u00020\u00162\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J\u0019\u0010*\u001a\u00020\u00162\u0006\u0010\u0015\u001a\u00020\u00142\u0006\u0010\u0013\u001a\u00020&H\u0096\u0001J\u001b\u0010,\u001a\u00020\u00162\b\u0010+\u001a\u0004\u0018\u00010\u00182\u0006\u0010\u001b\u001a\u00020\u001aH\u0096\u0001J\u0019\u0010/\u001a\u00020\u00162\u0006\u0010.\u001a\u00020-2\u0006\u0010\u0015\u001a\u00020\u0014H\u0096\u0001J\u0019\u00104\u001a\u00020\u00162\u0006\u00101\u001a\u0002002\u0006\u00103\u001a\u000202H\u0096\u0001J\u0019\u00105\u001a\u00020\u00162\u0006\u0010\u0015\u001a\u00020\u00142\u0006\u00103\u001a\u000202H\u0096\u0001J$\u00106\u001a\u00020\u00102\u0006\u0010\u0007\u001a\u00020\u00062\b\u0010\t\u001a\u0004\u0018\u00010\b2\b\u0010\u000b\u001a\u0004\u0018\u00010\nH\u0016J\n\u00108\u001a\u0004\u0018\u000107H\u0016J\n\u00109\u001a\u0004\u0018\u00010\u001cH\u0016J\u001a\u0010;\u001a\u00020\u00162\u0006\u0010:\u001a\u00020\u00102\b\u0010\u000b\u001a\u0004\u0018\u00010\nH\u0016R\"\u0010C\u001a\u00020<8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b=\u0010>\u001a\u0004\b?\u0010@\"\u0004\bA\u0010BR\u001b\u0010\u000f\u001a\u00020D8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\bE\u0010F\u001a\u0004\bG\u0010HR\u0014\u0010K\u001a\u00020\u00038\u0016X\u0096\u0005¢\u0006\u0006\u001a\u0004\bI\u0010J¨\u0006N"}, d2 = {"Lca/canadapost/module/epostprofile/userprofile/AccountDeletionDialogFragment;", "Lca/canadapost/core/common/ui/b;", "", "Lzb/c;", "Lw8/o;", "Lw8/p0;", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroidx/lifecycle/u;", "viewLifecycleOwner", "Landroidx/lifecycle/z0;", "viewModel", "Landroid/view/View;", "L", "Ll8/c;", Constants.IPC_BUNDLE_KEY_SEND_ERROR, "Landroidx/fragment/app/f;", "fragment", "Lrm/n0;", "G", "Lca/canadapost/core/data/model/ValidationError;", "validationError", "Landroid/content/Context;", "context", "", "m", "code", "message", "n", "i", "j", "h", "d", "a", "Lca/canadapost/core/data/model/ResultWrapper$Error;", "e", "l", "o", "g", "valError", "k", "Ll8/h;", "spinnerVM", "H", "Landroid/app/Activity;", "activity", "Ll8/h$b;", "event", "c", "p", "onCreateView", "Landroidx/appcompat/widget/Toolbar;", "C", "B", "view", "onViewCreated", "Landroidx/lifecycle/c1$c;", "s", "Landroidx/lifecycle/c1$c;", "K", "()Landroidx/lifecycle/c1$c;", "setViewModelFactory", "(Landroidx/lifecycle/c1$c;)V", "viewModelFactory", "Lcc/f;", "t", "Lrm/o;", "J", "()Lcc/f;", "I", "()Lzb/c;", "binding", "<init>", "()V", "epostprofile_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class AccountDeletionDialogFragment extends ca.canadapost.core.common.ui.b implements o, p0 {

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

    /* renamed from: p, reason: collision with root package name */
    private final /* synthetic */ x f8797p = new x(j.f31202b);

    /* renamed from: q, reason: collision with root package name */
    private final /* synthetic */ k f8798q = new k(null, null, null, 7, null);

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

    /* renamed from: t, reason: collision with root package name and from kotlin metadata */
    private final rm.o viewModel = androidx.fragment.app.p0.a(this, kotlin.jvm.internal.p0.b(cc.f.class), new f(new e(this)), new g());

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

        /* JADX INFO: Access modifiers changed from: package-private */
        /* renamed from: ca.canadapost.module.epostprofile.userprofile.AccountDeletionDialogFragment$a$a, reason: collision with other inner class name */
        /* loaded from: classes4.dex */
        public static final class C0247a extends v implements dn.a {

            /* renamed from: p, reason: collision with root package name */
            final /* synthetic */ AccountDeletionDialogFragment f8803p;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            C0247a(AccountDeletionDialogFragment accountDeletionDialogFragment) {
                super(0);
                this.f8803p = accountDeletionDialogFragment;
            }

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

            /* renamed from: invoke, reason: collision with other method in class */
            public final void m101invoke() {
                this.f8803p.J().V();
            }
        }

        a() {
            super(1);
        }

        public final void a(n0 n0Var) {
            g.a aVar = u8.g.f36993k;
            Context requireContext = AccountDeletionDialogFragment.this.requireContext();
            String string = AccountDeletionDialogFragment.this.getString(ob.l.f31360x1);
            t.f(string, "getString(...)");
            u8.g m10 = aVar.m(requireContext, string, AccountDeletionDialogFragment.this.getString(ob.l.f31365y1));
            m10.o(new C0247a(AccountDeletionDialogFragment.this));
            m10.x(AccountDeletionDialogFragment.this.requireContext());
        }

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

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

        /* JADX INFO: Access modifiers changed from: package-private */
        /* loaded from: classes4.dex */
        public static final class a extends v implements dn.a {

            /* renamed from: p, reason: collision with root package name */
            final /* synthetic */ AccountDeletionDialogFragment f8805p;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            a(AccountDeletionDialogFragment accountDeletionDialogFragment) {
                super(0);
                this.f8805p = accountDeletionDialogFragment;
            }

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

            /* renamed from: invoke, reason: collision with other method in class */
            public final void m102invoke() {
                this.f8805p.J().b0();
            }
        }

        /* JADX INFO: Access modifiers changed from: package-private */
        /* renamed from: ca.canadapost.module.epostprofile.userprofile.AccountDeletionDialogFragment$b$b, reason: collision with other inner class name */
        /* loaded from: classes4.dex */
        public static final class C0248b extends v implements dn.a {

            /* renamed from: p, reason: collision with root package name */
            final /* synthetic */ AccountDeletionDialogFragment f8806p;

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            C0248b(AccountDeletionDialogFragment accountDeletionDialogFragment) {
                super(0);
                this.f8806p = accountDeletionDialogFragment;
            }

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

            /* renamed from: invoke, reason: collision with other method in class */
            public final void m103invoke() {
                this.f8806p.J().b0();
            }
        }

        b() {
            super(1);
        }

        public final void a(n0 n0Var) {
            g.a aVar = u8.g.f36993k;
            Context requireContext = AccountDeletionDialogFragment.this.requireContext();
            String string = AccountDeletionDialogFragment.this.getString(ob.l.f31350v1);
            t.f(string, "getString(...)");
            u8.g j10 = aVar.j(requireContext, string, AccountDeletionDialogFragment.this.getString(ob.l.f31355w1));
            AccountDeletionDialogFragment accountDeletionDialogFragment = AccountDeletionDialogFragment.this;
            j10.o(new a(accountDeletionDialogFragment));
            j10.r(new C0248b(accountDeletionDialogFragment));
            j10.x(AccountDeletionDialogFragment.this.requireContext());
        }

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

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

        public final void a(n0 n0Var) {
            androidx.fragment.app.k activity = AccountDeletionDialogFragment.this.getActivity();
            if (activity != null) {
                activity.finish();
            }
        }

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

    /* loaded from: classes4.dex */
    static final class d implements g0, n {

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

        d(dn.l function) {
            t.g(function, "function");
            this.f8808a = function;
        }

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

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

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

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

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

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ androidx.fragment.app.f f8809p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public e(androidx.fragment.app.f fVar) {
            super(0);
            this.f8809p = fVar;
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final androidx.fragment.app.f invoke() {
            return this.f8809p;
        }
    }

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

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.a f8810p;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public f(dn.a aVar) {
            super(0);
            this.f8810p = aVar;
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final d1 invoke() {
            d1 viewModelStore = ((e1) this.f8810p.invoke()).getViewModelStore();
            t.f(viewModelStore, "ownerProducer().viewModelStore");
            return viewModelStore;
        }
    }

    /* loaded from: classes4.dex */
    static final class g extends v implements dn.a {
        g() {
            super(0);
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final c1.c invoke() {
            return AccountDeletionDialogFragment.this.K();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final cc.f J() {
        return (cc.f) this.viewModel.getValue();
    }

    @Override // ca.canadapost.core.common.ui.b
    public String B() {
        return getString(ob.l.f31345u1);
    }

    @Override // ca.canadapost.core.common.ui.b
    public Toolbar C() {
        u7.c appBarBinding = I().B.getAppBarBinding();
        if (appBarBinding != null) {
            return appBarBinding.B;
        }
        return null;
    }

    public void G(l8.c error, androidx.fragment.app.f fragment) {
        t.g(error, "error");
        t.g(fragment, "fragment");
        this.f8798q.b(error, fragment);
    }

    public void H(h spinnerVM, androidx.fragment.app.f fragment) {
        t.g(spinnerVM, "spinnerVM");
        t.g(fragment, "fragment");
        this.f8799r.b(spinnerVM, fragment);
    }

    public zb.c I() {
        return (zb.c) this.f8797p.b();
    }

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

    public View L(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, u viewLifecycleOwner, z0 viewModel) {
        t.g(inflater, "inflater");
        t.g(viewLifecycleOwner, "viewLifecycleOwner");
        t.g(viewModel, "viewModel");
        return this.f8797p.c(inflater, container, savedInstanceState, viewLifecycleOwner, viewModel);
    }

    @Override // w8.o
    public String a(Context context) {
        t.g(context, "context");
        return this.f8798q.a(context);
    }

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

    @Override // w8.o
    public String d(Context context) {
        t.g(context, "context");
        return this.f8798q.d(context);
    }

    @Override // w8.o
    public void e(ResultWrapper.Error error, Context context) {
        t.g(error, "error");
        t.g(context, "context");
        this.f8798q.e(error, context);
    }

    @Override // w8.o
    public void g(androidx.fragment.app.f fragment, ResultWrapper.Error error) {
        t.g(fragment, "fragment");
        t.g(error, "error");
        this.f8798q.g(fragment, error);
    }

    @Override // w8.o
    public String h(Context context) {
        t.g(context, "context");
        return this.f8798q.h(context);
    }

    @Override // w8.o
    public String i(ValidationError validationError, Context context) {
        t.g(context, "context");
        return this.f8798q.i(validationError, context);
    }

    @Override // w8.o
    public String j(String code, Context context) {
        t.g(code, "code");
        t.g(context, "context");
        return this.f8798q.j(code, context);
    }

    @Override // w8.o
    public void k(ValidationError validationError, Context context) {
        t.g(context, "context");
        this.f8798q.k(validationError, context);
    }

    @Override // w8.o
    public void l(androidx.fragment.app.f fragment, ResultWrapper.Error error) {
        t.g(fragment, "fragment");
        t.g(error, "error");
        this.f8798q.l(fragment, error);
    }

    @Override // w8.o
    public String m(ValidationError validationError, Context context) {
        t.g(context, "context");
        return this.f8798q.m(validationError, context);
    }

    @Override // w8.o
    public String n(String code, String message, Context context) {
        t.g(code, "code");
        t.g(context, "context");
        return this.f8798q.n(code, message, context);
    }

    @Override // w8.o
    public void o(Context context) {
        t.g(context, "context");
        this.f8798q.o(context);
    }

    @Override // androidx.fragment.app.f
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        t.g(inflater, "inflater");
        LayoutInflater from = LayoutInflater.from(getContext());
        t.f(from, "from(...)");
        u viewLifecycleOwner = getViewLifecycleOwner();
        t.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        return L(from, null, savedInstanceState, viewLifecycleOwner, J());
    }

    @Override // ca.canadapost.core.common.ui.b, androidx.fragment.app.f
    public void onViewCreated(View view, Bundle bundle) {
        t.g(view, "view");
        super.onViewCreated(view, bundle);
        H(J(), this);
        G(J(), this);
        u0.a aVar = u0.f41013a;
        Context requireContext = requireContext();
        t.f(requireContext, "requireContext(...)");
        if (aVar.a(requireContext)) {
            Linkify.addLinks(I().A, Patterns.PHONE, "tel:", Linkify.sPhoneNumberMatchFilter, Linkify.sPhoneNumberTransformFilter);
            Context context = getContext();
            if (context != null) {
                I().A.setLinkTextColor(context.getColor(ob.g.f31112a));
            }
            I().A.setLinksClickable(true);
        }
        J().X().j(getViewLifecycleOwner(), new d(new a()));
        J().W().j(getViewLifecycleOwner(), new d(new b()));
        J().Z().j(getViewLifecycleOwner(), new d(new c()));
        J().U();
    }

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