package ie;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.p0;
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.mymail.model.MyMailCommercialDetailsUIModel;
import ca.canadapost.module.mymail.subscribed.i;
import ca.canadapost.module.mymail.subscribed.m;
import dn.l;
import java.util.List;
import kotlin.Metadata;
import kotlin.jvm.internal.k;
import kotlin.jvm.internal.n;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import rm.c0;
import rm.n0;
import rm.o;
import rm.q;
import u7.x;
import w8.w;
import yd.i;
import yd.j;

@Metadata(d1 = {"\u0000T\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\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\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\b\u0018\u0000 (2\u00020\u00012\b\u0012\u0004\u0012\u00020\u00030\u0002:\u0001)B\u0007¢\u0006\u0004\b&\u0010'J5\u0010\u000f\u001a\u00020\u000e2\u0006\u0010\u0005\u001a\u00020\u00042\b\u0010\u0007\u001a\u0004\u0018\u00010\u00062\b\u0010\t\u001a\u0004\u0018\u00010\b2\u0006\u0010\u000b\u001a\u00020\n2\u0006\u0010\r\u001a\u00020\fH\u0096\u0001J$\u0010\u0010\u001a\u00020\u000e2\u0006\u0010\u0005\u001a\u00020\u00042\b\u0010\u0007\u001a\u0004\u0018\u00010\u00062\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0016J\u001a\u0010\u0013\u001a\u00020\u00122\u0006\u0010\u0011\u001a\u00020\u000e2\b\u0010\t\u001a\u0004\u0018\u00010\bH\u0016R\u001b\u0010\u0019\u001a\u00020\u00148BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0015\u0010\u0016\u001a\u0004\b\u0017\u0010\u0018R\"\u0010!\u001a\u00020\u001a8\u0004@\u0004X\u0085.¢\u0006\u0012\n\u0004\b\u001b\u0010\u001c\u001a\u0004\b\u001d\u0010\u001e\"\u0004\b\u001f\u0010 R\u001b\u0010\r\u001a\u00020\"8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b#\u0010\u0016\u001a\u0004\b$\u0010%¨\u0006*"}, d2 = {"Lie/a;", "Lu8/b;", "", "Lae/a0;", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroidx/lifecycle/u;", "viewLifecycleOwner", "Landroidx/lifecycle/z0;", "viewModel", "Landroid/view/View;", "L", "onCreateView", "view", "Lrm/n0;", "onViewCreated", "Lca/canadapost/module/mymail/subscribed/m;", "t", "Lrm/o;", "J", "()Lca/canadapost/module/mymail/subscribed/m;", "myMailSubscribedTabsViewModel", "Lie/d;", "u", "Lie/d;", "I", "()Lie/d;", "setMyMailDeliveredViewModelFactory", "(Lie/d;)V", "myMailDeliveredViewModelFactory", "Lie/c;", "v", "K", "()Lie/c;", "<init>", "()V", "w", "a", "mymail_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class a extends u8.b {

    /* renamed from: w, reason: collision with root package name and from kotlin metadata */
    public static final Companion INSTANCE = new Companion(null);

    /* renamed from: s, reason: collision with root package name */
    private final /* synthetic */ x f23148s = new x(j.f52324n);

    /* renamed from: t, reason: collision with root package name and from kotlin metadata */
    private final o myMailSubscribedTabsViewModel = p0.a(this, kotlin.jvm.internal.p0.b(m.class), new f(this), new b());

    /* renamed from: u, reason: collision with root package name and from kotlin metadata */
    protected ie.d myMailDeliveredViewModelFactory;

    /* renamed from: v, reason: collision with root package name and from kotlin metadata */
    private final o viewModel;

    /* renamed from: ie.a$a, reason: collision with other inner class name and from kotlin metadata */
    /* loaded from: classes4.dex */
    public static final class Companion {
        private Companion() {
        }

        public /* synthetic */ Companion(k kVar) {
            this();
        }

        public final a a(int i10) {
            a aVar = new a();
            Bundle bundle = new Bundle();
            bundle.putInt("my_mail_subscribed_delivered_tab_position", i10);
            aVar.setArguments(bundle);
            return aVar;
        }
    }

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

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

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

        public final void a(MyMailCommercialDetailsUIModel myMailCommercialDetailsUIModel) {
            w.d(x4.d.a(a.this), i.f52279a, androidx.core.os.c.a(c0.a("myMailCommercialDetailsUIModelArg", myMailCommercialDetailsUIModel)), null, 4, null);
        }

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

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

        public final void a(n0 n0Var) {
            w.d(x4.d.a(a.this), i.f52281b, null, null, 6, null);
        }

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

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

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

        e(l function) {
            t.g(function, "function");
            this.f23155a = function;
        }

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

        @Override // androidx.lifecycle.g0
        public final /* synthetic */ void d(Object obj) {
            this.f23155a.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 f extends v implements dn.a {

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

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

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

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

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

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

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

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

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

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

        /* renamed from: ie.a$h$a, reason: collision with other inner class name */
        /* loaded from: classes4.dex */
        public static final class C0489a implements c1.c {

            /* renamed from: b, reason: collision with root package name */
            final /* synthetic */ a f23160b;

            public C0489a(a aVar) {
                this.f23160b = aVar;
            }

            @Override // androidx.lifecycle.c1.c
            public z0 a(Class modelClass) {
                i.a aVar;
                t.g(modelClass, "modelClass");
                ie.d I = this.f23160b.I();
                List list = (List) this.f23160b.J().F0().f();
                if (list == null || (aVar = (i.a) list.get(this.f23160b.requireArguments().getInt("my_mail_subscribed_delivered_tab_position"))) == null) {
                    aVar = new i.a(i.b.INCOMING_EMPTY_MAILS, null, null, null, 14, null);
                }
                ie.c a10 = I.a(aVar);
                t.e(a10, "null cannot be cast to non-null type U of ca.canadapost.core.common.utils.KotlinExtensionsKt.viewModels.<no name provided>.invoke.<no name provided>.create");
                return a10;
            }
        }

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

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final z0 invoke() {
            return new c1((e1) this.f23158p.invoke(), new C0489a(this.f23159q)).a(ie.c.class);
        }
    }

    public a() {
        o a10;
        a10 = q.a(new h(new g(this), this));
        this.viewModel = a10;
    }

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

    private final ie.c K() {
        return (ie.c) this.viewModel.getValue();
    }

    protected final ie.d I() {
        ie.d dVar = this.myMailDeliveredViewModelFactory;
        if (dVar != null) {
            return dVar;
        }
        t.y("myMailDeliveredViewModelFactory");
        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.f23148s.c(inflater, container, savedInstanceState, viewLifecycleOwner, viewModel);
    }

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

    @Override // u8.b, androidx.fragment.app.f
    public void onViewCreated(View view, Bundle bundle) {
        t.g(view, "view");
        super.onViewCreated(view, bundle);
        K().U().j(getViewLifecycleOwner(), new e(new c()));
        K().V().j(getViewLifecycleOwner(), new e(new d()));
    }
}
