package ca.canadapost.module.findrate;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.Spinner;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.s0;
import androidx.lifecycle.c1;
import androidx.lifecycle.e1;
import androidx.lifecycle.z0;
import ca.canadapost.core.common.navigation.ui.d;
import ca.canadapost.core.data.findrate.model.FindRateDataModel;
import ca.canadapost.core.data.findrate.model.FindRateResponseItem;
import ca.canadapost.core.data.findrate.model.FindRateResponseOption;
import ca.canadapost.core.data.model.ResultWrapper;
import ca.canadapost.core.data.model.ValidationError;
import ca.canadapost.module.findrate.RateDetailsFragment;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.google.firebase.messaging.Constants;
import dc.d0;
import dc.e0;
import dc.f0;
import dc.h0;
import dc.i0;
import dc.n0;
import java.io.Serializable;
import java.math.BigDecimal;
import java.security.InvalidParameterException;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import kotlin.Metadata;
import kotlin.jvm.internal.u0;
import kotlin.jvm.internal.v;
import l8.h;
import n8.e0;
import o8.g0;
import sm.c0;
import u7.x;
import w8.j0;
import w8.p0;
import w8.t0;

@Metadata(d1 = {"\u0000\u0090\u0002\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\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\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\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\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\u0007\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\u0007\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\n\u0018\u0000 \u0096\u00012\u00020\u00012\b\u0012\u0004\u0012\u00020\u00030\u00022\u00020\u00042\u00020\u00052\u00020\u0006:\u0002FTB\t¢\u0006\u0006\b\u0094\u0001\u0010\u0095\u0001J \u0010\f\u001a\u00020\u000b2\u0006\u0010\b\u001a\u00020\u00072\u0006\u0010\t\u001a\u00020\u00072\u0006\u0010\n\u001a\u00020\u0007H\u0002J$\u0010\r\u001a\u00020\u000b2\u0006\u0010\b\u001a\u00020\u00072\u0006\u0010\t\u001a\u00020\u00072\n\b\u0002\u0010\n\u001a\u0004\u0018\u00010\u0007H\u0002J \u0010\u000e\u001a\u00020\u000b2\u0006\u0010\b\u001a\u00020\u00072\u0006\u0010\t\u001a\u00020\u00072\u0006\u0010\n\u001a\u00020\u0007H\u0002J\b\u0010\u000f\u001a\u00020\u000bH\u0002J\u0010\u0010\u0012\u001a\u00020\u000b2\u0006\u0010\u0011\u001a\u00020\u0010H\u0002J\u0010\u0010\u0014\u001a\u00020\u000b2\u0006\u0010\u0013\u001a\u00020\u0010H\u0002J\u0016\u0010\u0018\u001a\u00020\u000b2\f\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\u00160\u0015H\u0002J\u0018\u0010\u001c\u001a\u00020\u000b2\u0006\u0010\u001a\u001a\u00020\u00192\u0006\u0010\u001b\u001a\u00020\u0016H\u0002J\u0010\u0010\u001d\u001a\u00020\u00072\u0006\u0010\u001b\u001a\u00020\u0016H\u0002J\u0012\u0010 \u001a\u00020\u000b2\b\u0010\u001f\u001a\u0004\u0018\u00010\u001eH\u0002J5\u0010+\u001a\u00020\u00192\u0006\u0010\"\u001a\u00020!2\b\u0010$\u001a\u0004\u0018\u00010#2\b\u0010&\u001a\u0004\u0018\u00010%2\u0006\u0010(\u001a\u00020'2\u0006\u0010*\u001a\u00020)H\u0096\u0001J\u0019\u00100\u001a\u00020\u000b2\u0006\u0010-\u001a\u00020,2\u0006\u0010/\u001a\u00020.H\u0096\u0001J\u0019\u00105\u001a\u00020\u000b2\u0006\u00102\u001a\u0002012\u0006\u00104\u001a\u000203H\u0096\u0001J\u0019\u00106\u001a\u00020\u000b2\u0006\u0010/\u001a\u00020.2\u0006\u00104\u001a\u000203H\u0096\u0001J\u0019\u00109\u001a\u00020\u000b2\u0006\u00108\u001a\u0002072\u0006\u0010/\u001a\u00020.H\u0096\u0001J\u001b\u0010>\u001a\u00020\u00072\b\u0010;\u001a\u0004\u0018\u00010:2\u0006\u0010=\u001a\u00020<H\u0096\u0001J#\u0010A\u001a\u00020\u00072\u0006\u0010?\u001a\u00020\u00072\b\u0010@\u001a\u0004\u0018\u00010\u00072\u0006\u0010=\u001a\u00020<H\u0096\u0001J\u001b\u0010B\u001a\u00020\u00072\b\u0010;\u001a\u0004\u0018\u00010:2\u0006\u0010=\u001a\u00020<H\u0096\u0001J\u0019\u0010C\u001a\u00020\u00072\u0006\u0010?\u001a\u00020\u00072\u0006\u0010=\u001a\u00020<H\u0096\u0001J\u0011\u0010D\u001a\u00020\u00072\u0006\u0010=\u001a\u00020<H\u0096\u0001J\u0011\u0010E\u001a\u00020\u00072\u0006\u0010=\u001a\u00020<H\u0096\u0001J\u0011\u0010F\u001a\u00020\u00072\u0006\u0010=\u001a\u00020<H\u0096\u0001J\u0019\u0010H\u001a\u00020\u000b2\u0006\u00108\u001a\u00020G2\u0006\u0010=\u001a\u00020<H\u0096\u0001J\u0019\u0010I\u001a\u00020\u000b2\u0006\u0010/\u001a\u00020.2\u0006\u00108\u001a\u00020GH\u0096\u0001J\u0011\u0010J\u001a\u00020\u000b2\u0006\u0010=\u001a\u00020<H\u0096\u0001J\u0019\u0010K\u001a\u00020\u000b2\u0006\u0010/\u001a\u00020.2\u0006\u00108\u001a\u00020GH\u0096\u0001J\u001b\u0010M\u001a\u00020\u000b2\b\u0010L\u001a\u0004\u0018\u00010:2\u0006\u0010=\u001a\u00020<H\u0096\u0001J#\u0010R\u001a\u00020\u000b2\u0006\u0010O\u001a\u00020N2\u0006\u0010/\u001a\u00020.2\b\b\u0002\u0010Q\u001a\u00020PH\u0096\u0001J#\u0010T\u001a\u00020\u000b2\u0006\u0010O\u001a\u00020N2\u0006\u00102\u001a\u00020S2\b\b\u0002\u0010Q\u001a\u00020PH\u0096\u0001J\u0012\u0010U\u001a\u00020\u000b2\b\u0010&\u001a\u0004\u0018\u00010%H\u0016J$\u0010V\u001a\u00020\u00192\u0006\u0010\"\u001a\u00020!2\b\u0010$\u001a\u0004\u0018\u00010#2\b\u0010&\u001a\u0004\u0018\u00010%H\u0016J\u001a\u0010W\u001a\u00020\u000b2\u0006\u0010\u001a\u001a\u00020\u00192\b\u0010&\u001a\u0004\u0018\u00010%H\u0016J\u0018\u0010[\u001a\u00020\u000b2\u0006\u0010Y\u001a\u00020X2\u0006\u0010\"\u001a\u00020ZH\u0016J\u0010\u0010^\u001a\u00020P2\u0006\u0010]\u001a\u00020\\H\u0016R\"\u0010f\u001a\u00020_8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\b`\u0010a\u001a\u0004\bb\u0010c\"\u0004\bd\u0010eR\"\u0010n\u001a\u00020g8\u0004@\u0004X\u0085.¢\u0006\u0012\n\u0004\bh\u0010i\u001a\u0004\bj\u0010k\"\u0004\bl\u0010mR\"\u0010v\u001a\u00020o8\u0004@\u0004X\u0085.¢\u0006\u0012\n\u0004\bp\u0010q\u001a\u0004\br\u0010s\"\u0004\bt\u0010uR\"\u0010~\u001a\u00020w8\u0006@\u0006X\u0087.¢\u0006\u0012\n\u0004\bx\u0010y\u001a\u0004\bz\u0010{\"\u0004\b|\u0010}R)\u0010\u0086\u0001\u001a\u00020\u007f8\u0006@\u0006X\u0087.¢\u0006\u0018\n\u0006\b\u0080\u0001\u0010\u0081\u0001\u001a\u0006\b\u0082\u0001\u0010\u0083\u0001\"\u0006\b\u0084\u0001\u0010\u0085\u0001R \u0010*\u001a\u00030\u0087\u00018BX\u0082\u0084\u0002¢\u0006\u0010\n\u0006\b\u0088\u0001\u0010\u0089\u0001\u001a\u0006\b\u008a\u0001\u0010\u008b\u0001R!\u0010\u0090\u0001\u001a\n\u0012\u0005\u0012\u00030\u008d\u00010\u008c\u00018\u0002@\u0002X\u0082.¢\u0006\b\n\u0006\b\u008e\u0001\u0010\u008f\u0001R\u0017\u0010\u0093\u0001\u001a\u00020\u00038\u0016X\u0096\u0005¢\u0006\b\u001a\u0006\b\u0091\u0001\u0010\u0092\u0001¨\u0006\u0097\u0001"}, d2 = {"Lca/canadapost/module/findrate/RateDetailsFragment;", "Lu8/b;", "", "Lec/q;", "Lw8/p0;", "Lw8/o;", "Lca/canadapost/core/common/navigation/ui/d;", "", "heading", FirebaseAnalytics.Param.CONTENT, "detailUrl", "Lrm/n0;", "m0", "o0", "n0", "b0", "Ldc/i0;", Constants.ScionAnalytics.MessageType.DATA_MESSAGE, "g0", "coverageData", "e0", "", "Lca/canadapost/core/data/findrate/model/FindRateResponseOption;", "options", "i0", "Landroid/view/View;", "view", "optionItem", "l0", "Y", "Ldc/d;", "info", "h0", "Landroid/view/LayoutInflater;", "inflater", "Landroid/view/ViewGroup;", "container", "Landroid/os/Bundle;", "savedInstanceState", "Landroidx/lifecycle/u;", "viewLifecycleOwner", "Landroidx/lifecycle/z0;", "viewModel", "c0", "Ll8/h;", "spinnerVM", "Landroidx/fragment/app/f;", "fragment", "T", "Landroid/app/Activity;", "activity", "Ll8/h$b;", "event", "c", "p", "Ll8/c;", Constants.IPC_BUNDLE_KEY_SEND_ERROR, "S", "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", "Lo8/h0;", "profileNavigationVMHandler", "", "showTwoSv", "f", "Landroidx/fragment/app/k;", "b", "onCreate", "onCreateView", "onViewCreated", "Landroid/view/Menu;", "menu", "Landroid/view/MenuInflater;", "onCreateOptionsMenu", "Landroid/view/MenuItem;", "item", "onOptionsItemSelected", "Lca/a;", "w", "Lca/a;", "W", "()Lca/a;", "setLanguageService", "(Lca/a;)V", "languageService", "Ldc/n0;", "x", "Ldc/n0;", "Z", "()Ldc/n0;", "setRateDetailsViewModelFactory", "(Ldc/n0;)V", "rateDetailsViewModelFactory", "Lkm/t;", "y", "Lkm/t;", "X", "()Lkm/t;", "setMoshi", "(Lkm/t;)V", "moshi", "Lt7/c;", "z", "Lt7/c;", "V", "()Lt7/c;", "setContextService", "(Lt7/c;)V", "contextService", "Lp9/h;", "A", "Lp9/h;", "getFeatureFlagRepository", "()Lp9/h;", "setFeatureFlagRepository", "(Lp9/h;)V", "featureFlagRepository", "Lca/canadapost/module/findrate/c;", "B", "Lrm/o;", "a0", "()Lca/canadapost/module/findrate/c;", "Landroid/widget/ArrayAdapter;", "Lca/canadapost/module/findrate/RateDetailsFragment$b;", "C", "Landroid/widget/ArrayAdapter;", "spinnerAdapter", "U", "()Lec/q;", "binding", "<init>", "()V", "D", "findrate_productionRelease"}, k = 1, mv = {1, 9, 0})
/* loaded from: classes4.dex */
public final class RateDetailsFragment extends u8.b implements p0, w8.o, ca.canadapost.core.common.navigation.ui.d {

    /* renamed from: A, reason: from kotlin metadata */
    public p9.h featureFlagRepository;

    /* renamed from: B, reason: from kotlin metadata */
    private final rm.o viewModel;

    /* renamed from: C, reason: from kotlin metadata */
    private ArrayAdapter spinnerAdapter;

    /* renamed from: s, reason: collision with root package name */
    private final /* synthetic */ x f9159s = new x(e0.f16047l);

    /* renamed from: t, reason: collision with root package name */
    private final /* synthetic */ w8.l f9160t = new w8.l();

    /* renamed from: u, reason: collision with root package name */
    private final /* synthetic */ w8.k f9161u = new w8.k(null, null, null, 7, null);

    /* renamed from: v, reason: collision with root package name */
    private final /* synthetic */ g0 f9162v = new g0();

    /* renamed from: w, reason: collision with root package name and from kotlin metadata */
    public ca.a languageService;

    /* renamed from: x, reason: collision with root package name and from kotlin metadata */
    protected n0 rateDetailsViewModelFactory;

    /* renamed from: y, reason: collision with root package name and from kotlin metadata */
    protected km.t moshi;

    /* renamed from: z, reason: collision with root package name and from kotlin metadata */
    public t7.c contextService;

    /* JADX INFO: Access modifiers changed from: private */
    /* loaded from: classes4.dex */
    public static final class b extends qa.c {
        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        public b(String string, float f10) {
            super(string, Float.valueOf(f10));
            kotlin.jvm.internal.t.g(string, "string");
        }
    }

    /* loaded from: classes4.dex */
    public static final class c extends androidx.core.view.a {
        c() {
        }

        @Override // androidx.core.view.a
        public void f(View host, AccessibilityEvent event) {
            kotlin.jvm.internal.t.g(host, "host");
            kotlin.jvm.internal.t.g(event, "event");
            if (event.getEventType() == 32768) {
                super.f(host, event);
            }
        }
    }

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

        public final void a(Boolean bool) {
            RateDetailsFragment.this.a0().R0();
        }

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

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

        public final void a(Boolean bool) {
            RateDetailsFragment.this.a0().R0();
        }

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

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

        public final void a(dc.d dVar) {
            RateDetailsFragment.this.h0(dVar);
        }

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

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

        public final void a(List list) {
            if (list != null) {
                RateDetailsFragment.this.i0(list);
            }
        }

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

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

        public final void a(i0 i0Var) {
            if (i0Var == null) {
                RateDetailsFragment.this.U().D.B.setVisibility(8);
                return;
            }
            RateDetailsFragment.this.U().D.B.setVisibility(0);
            RateDetailsFragment.this.e0(i0Var);
            RateDetailsFragment.this.g0(i0Var);
        }

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

    /* loaded from: classes4.dex */
    static final class i 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.l {

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

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            a(RateDetailsFragment rateDetailsFragment) {
                super(1);
                this.f9173p = rateDetailsFragment;
            }

            public final void a(boolean z10) {
                if (z10) {
                    Bundle bundle = new Bundle();
                    bundle.putString("ARG_EMISSION_KEY", String.valueOf(this.f9173p.a0().d0().f()));
                    x4.d.a(this.f9173p).N(d0.f15992f, bundle);
                    return;
                }
                RateDetailsFragment rateDetailsFragment = this.f9173p;
                String string = rateDetailsFragment.getString(h0.L);
                kotlin.jvm.internal.t.f(string, "getString(...)");
                String string2 = this.f9173p.getString(h0.K);
                kotlin.jvm.internal.t.f(string2, "getString(...)");
                String string3 = this.f9173p.getString(h0.S);
                kotlin.jvm.internal.t.f(string3, "getString(...)");
                rateDetailsFragment.m0(string, string2, string3);
            }

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

        i() {
            super(1);
        }

        public final void a(rm.n0 n0Var) {
            RateDetailsFragment.this.a0().F0(new a(RateDetailsFragment.this));
        }

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

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

        public final void a(BigDecimal bigDecimal) {
            TextView textView = RateDetailsFragment.this.U().C.G;
            RateDetailsFragment rateDetailsFragment = RateDetailsFragment.this;
            int i10 = h0.f16121w0;
            String bigDecimal2 = bigDecimal.toString();
            kotlin.jvm.internal.t.f(bigDecimal2, "toString(...)");
            Activity b10 = RateDetailsFragment.this.V().b();
            kotlin.jvm.internal.t.f(b10, "getCurrentActivity(...)");
            textView.setText(rateDetailsFragment.getString(i10, t0.a(bigDecimal2, b10)));
            TextView textView2 = RateDetailsFragment.this.U().C.G;
            RateDetailsFragment rateDetailsFragment2 = RateDetailsFragment.this;
            int i11 = h0.f16123x0;
            String bigDecimal3 = bigDecimal.toString();
            kotlin.jvm.internal.t.f(bigDecimal3, "toString(...)");
            Activity b11 = RateDetailsFragment.this.V().b();
            kotlin.jvm.internal.t.f(b11, "getCurrentActivity(...)");
            textView2.setContentDescription(rateDetailsFragment2.getString(i11, t0.a(bigDecimal3, b11)));
        }

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

    /* loaded from: classes4.dex */
    static final class k 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.l {

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

            /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
            a(RateDetailsFragment rateDetailsFragment) {
                super(1);
                this.f9176p = rateDetailsFragment;
            }

            public final void a(boolean z10) {
                if (z10) {
                    x4.d.a(this.f9176p).M(d0.f15998i);
                    return;
                }
                RateDetailsFragment rateDetailsFragment = this.f9176p;
                String string = rateDetailsFragment.getString(h0.O);
                kotlin.jvm.internal.t.f(string, "getString(...)");
                String string2 = this.f9176p.getString(h0.N);
                kotlin.jvm.internal.t.f(string2, "getString(...)");
                String string3 = this.f9176p.getString(h0.Q);
                kotlin.jvm.internal.t.f(string3, "getString(...)");
                rateDetailsFragment.m0(string, string2, string3);
            }

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

        k() {
            super(1);
        }

        public final void a(rm.n0 n0Var) {
            RateDetailsFragment.this.a0().F0(new a(RateDetailsFragment.this));
        }

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

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

        public final void a(rm.n0 n0Var) {
            RateDetailsFragment rateDetailsFragment = RateDetailsFragment.this;
            String string = rateDetailsFragment.getString(h0.f16080f0);
            kotlin.jvm.internal.t.f(string, "getString(...)");
            String string2 = RateDetailsFragment.this.getString(h0.f16083g0);
            kotlin.jvm.internal.t.f(string2, "getString(...)");
            String string3 = RateDetailsFragment.this.getString(h0.f16066a1);
            kotlin.jvm.internal.t.f(string3, "getString(...)");
            rateDetailsFragment.n0(string, string2, string3);
        }

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

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

        public final void a(rm.n0 n0Var) {
            RateDetailsFragment rateDetailsFragment = RateDetailsFragment.this;
            String string = rateDetailsFragment.getString(h0.f16125y0);
            kotlin.jvm.internal.t.f(string, "getString(...)");
            String string2 = RateDetailsFragment.this.getString(h0.f16127z0);
            kotlin.jvm.internal.t.f(string2, "getString(...)");
            RateDetailsFragment.p0(rateDetailsFragment, string, string2, null, 4, null);
        }

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

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

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

        n(dn.l function) {
            kotlin.jvm.internal.t.g(function, "function");
            this.f9179a = function;
        }

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

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

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

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

    /* loaded from: classes4.dex */
    public static final class o implements AdapterView.OnItemSelectedListener {
        o() {
        }

        @Override // android.widget.AdapterView.OnItemSelectedListener
        public void onItemSelected(AdapterView adapterView, View view, int i10, long j10) {
            Object itemAtPosition = adapterView != null ? adapterView.getItemAtPosition(i10) : null;
            kotlin.jvm.internal.t.e(itemAtPosition, "null cannot be cast to non-null type ca.canadapost.module.findrate.RateDetailsFragment.StringWithFloatTag");
            b bVar = (b) itemAtPosition;
            if (bVar.a() != null) {
                ca.canadapost.module.findrate.c a02 = RateDetailsFragment.this.a0();
                Object a10 = bVar.a();
                kotlin.jvm.internal.t.f(a10, "getTag(...)");
                a02.K0(((Number) a10).floatValue());
            }
        }

        @Override // android.widget.AdapterView.OnItemSelectedListener
        public void onNothingSelected(AdapterView adapterView) {
            kotlin.jvm.internal.t.g(adapterView, "adapterView");
        }
    }

    /* loaded from: classes4.dex */
    public static final class p implements Comparator {
        public p() {
        }

        @Override // java.util.Comparator
        public final int compare(Object obj, Object obj2) {
            int d10;
            d10 = um.c.d(RateDetailsFragment.this.Y((FindRateResponseOption) obj), RateDetailsFragment.this.Y((FindRateResponseOption) obj2));
            return d10;
        }
    }

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

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

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        q(String str) {
            super(0);
            this.f9183q = str;
        }

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

        /* renamed from: invoke, reason: collision with other method in class */
        public final void m132invoke() {
            e0.a aVar = n8.e0.f29852a;
            androidx.fragment.app.k requireActivity = RateDetailsFragment.this.requireActivity();
            kotlin.jvm.internal.t.f(requireActivity, "requireActivity(...)");
            aVar.a(requireActivity, this.f9183q);
        }
    }

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

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

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        r(String str) {
            super(0);
            this.f9185q = str;
        }

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

        /* renamed from: invoke, reason: collision with other method in class */
        public final void m133invoke() {
            e0.a aVar = n8.e0.f29852a;
            androidx.fragment.app.k requireActivity = RateDetailsFragment.this.requireActivity();
            kotlin.jvm.internal.t.f(requireActivity, "requireActivity(...)");
            aVar.a(requireActivity, this.f9185q);
        }
    }

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

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

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

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        s(String str, RateDetailsFragment rateDetailsFragment) {
            super(0);
            this.f9186p = str;
            this.f9187q = rateDetailsFragment;
        }

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

        /* renamed from: invoke, reason: collision with other method in class */
        public final void m134invoke() {
            String str = this.f9186p;
            if (str != null) {
                RateDetailsFragment rateDetailsFragment = this.f9187q;
                e0.a aVar = n8.e0.f29852a;
                androidx.fragment.app.k requireActivity = rateDetailsFragment.requireActivity();
                kotlin.jvm.internal.t.f(requireActivity, "requireActivity(...)");
                aVar.a(requireActivity, str);
            }
        }
    }

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

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

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

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

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

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

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

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

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

            public a(RateDetailsFragment rateDetailsFragment) {
                this.f9191b = rateDetailsFragment;
            }

            @Override // androidx.lifecycle.c1.c
            public z0 a(Class modelClass) {
                kotlin.jvm.internal.t.g(modelClass, "modelClass");
                n0 Z = this.f9191b.Z();
                FindRateResponseItem findRateResponseItem = (FindRateResponseItem) this.f9191b.X().c(FindRateResponseItem.class).b(this.f9191b.requireArguments().getString("ARG_RESPONSE_ITEM", ""));
                if (findRateResponseItem == null) {
                    throw new InvalidParameterException();
                }
                kotlin.jvm.internal.t.d(findRateResponseItem);
                Serializable serializable = this.f9191b.requireArguments().getSerializable("ARG_DATA_MODEL");
                kotlin.jvm.internal.t.e(serializable, "null cannot be cast to non-null type ca.canadapost.core.data.findrate.model.FindRateDataModel");
                ca.canadapost.module.findrate.c a10 = Z.a(findRateResponseItem, (FindRateDataModel) serializable);
                kotlin.jvm.internal.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 u(dn.a aVar, RateDetailsFragment rateDetailsFragment) {
            super(0);
            this.f9189p = aVar;
            this.f9190q = rateDetailsFragment;
        }

        @Override // dn.a
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final z0 invoke() {
            return new c1((e1) this.f9189p.invoke(), new a(this.f9190q)).a(ca.canadapost.module.findrate.c.class);
        }
    }

    public RateDetailsFragment() {
        rm.o a10;
        a10 = rm.q.a(new u(new t(this), this));
        this.viewModel = a10;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final String Y(FindRateResponseOption optionItem) {
        String str;
        int m10;
        Object f02;
        int e10 = W().e();
        String str2 = "";
        if (optionItem.getPrice() <= BitmapDescriptorFactory.HUE_RED) {
            List<String> names = optionItem.getNames();
            if (names == null) {
                return "";
            }
            f02 = c0.f0(names, e10);
            String str3 = (String) f02;
            return str3 == null ? "" : str3;
        }
        u0 u0Var = u0.f26205a;
        Object[] objArr = new Object[2];
        List<String> names2 = optionItem.getNames();
        if (names2 != null) {
            if (e10 >= 0) {
                m10 = sm.u.m(names2);
                if (e10 <= m10) {
                    str2 = names2.get(e10);
                }
            }
            str = str2;
        } else {
            str = null;
        }
        objArr[0] = str;
        objArr[1] = getString(h0.R, Float.valueOf(optionItem.getPrice()));
        String format = String.format("%s (%s)", Arrays.copyOf(objArr, 2));
        kotlin.jvm.internal.t.f(format, "format(...)");
        return format;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final ca.canadapost.module.findrate.c a0() {
        return (ca.canadapost.module.findrate.c) this.viewModel.getValue();
    }

    private final void b0() {
        s0.m0(U().D.A, new c());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void d0(RateDetailsFragment this$0, View view) {
        kotlin.jvm.internal.t.g(this$0, "this$0");
        x4.d.a(this$0).N(d0.G, androidx.core.os.c.a(rm.c0.a("clearViewModel", Boolean.TRUE)));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void e0(i0 i0Var) {
        int i10;
        ArrayList arrayList = new ArrayList();
        List b10 = i0Var.b();
        if (b10 != null) {
            Iterator it = b10.iterator();
            i10 = 0;
            while (it.hasNext()) {
                float floatValue = ((Number) it.next()).floatValue();
                String string = getString(h0.R, Float.valueOf(floatValue));
                kotlin.jvm.internal.t.f(string, "getString(...)");
                arrayList.add(new b(string, floatValue));
                if (i0Var.a() == floatValue) {
                    i10 = arrayList.size() - 1;
                }
            }
        } else {
            i10 = 0;
        }
        ArrayAdapter arrayAdapter = this.spinnerAdapter;
        ArrayAdapter arrayAdapter2 = null;
        if (arrayAdapter == null) {
            kotlin.jvm.internal.t.y("spinnerAdapter");
            arrayAdapter = null;
        }
        arrayAdapter.clear();
        ArrayAdapter arrayAdapter3 = this.spinnerAdapter;
        if (arrayAdapter3 == null) {
            kotlin.jvm.internal.t.y("spinnerAdapter");
            arrayAdapter3 = null;
        }
        arrayAdapter3.addAll(arrayList);
        ArrayAdapter arrayAdapter4 = this.spinnerAdapter;
        if (arrayAdapter4 == null) {
            kotlin.jvm.internal.t.y("spinnerAdapter");
        } else {
            arrayAdapter2 = arrayAdapter4;
        }
        arrayAdapter2.notifyDataSetChanged();
        U().D.A.setSelected(false);
        U().D.A.setSelection(i10, true);
        if (kotlin.jvm.internal.t.b(a0().u0().f(), requireActivity().getString(h0.f16067b))) {
            new Handler().postDelayed(new Runnable() { // from class: dc.k0
                @Override // java.lang.Runnable
                public final void run() {
                    RateDetailsFragment.f0(RateDetailsFragment.this);
                }
            }, 1000L);
            a0().Q0("");
        }
        U().D.A.setOnItemSelectedListener(new o());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void f0(RateDetailsFragment this$0) {
        kotlin.jvm.internal.t.g(this$0, "this$0");
        this$0.U().D.A.performAccessibilityAction(64, null);
        this$0.U().D.A.sendAccessibilityEvent(8);
        this$0.U().D.A.requestFocus();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void g0(i0 i0Var) {
        NumberFormat currencyInstance = NumberFormat.getCurrencyInstance(W().d());
        kotlin.jvm.internal.t.e(currencyInstance, "null cannot be cast to non-null type java.text.DecimalFormat");
        DecimalFormat decimalFormat = (DecimalFormat) currencyInstance;
        decimalFormat.setMaximumFractionDigits(2);
        decimalFormat.format(Float.valueOf(i0Var.d()));
        decimalFormat.setMaximumFractionDigits(0);
        decimalFormat.format(Float.valueOf(i0Var.e()));
        decimalFormat.format(Float.valueOf(i0Var.c()));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void h0(dc.d dVar) {
        if (dVar == null) {
            U().C.D.setVisibility(8);
            U().C.H.setVisibility(8);
            return;
        }
        U().C.D.setVisibility(0);
        U().C.H.setVisibility((dVar.c() && a0().R0()) ? 0 : 8);
        if (dVar.a() == 1 && dVar.b()) {
            U().C.E.setText(getString(h0.F));
        } else if (dVar.a() >= 1) {
            U().C.E.setText(getResources().getQuantityString(dc.g0.f16061a, dVar.a(), Integer.valueOf(dVar.a())));
        } else {
            U().C.D.setVisibility(8);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void i0(List list) {
        List<FindRateResponseOption> J0;
        U().D.E.removeAllViews();
        J0 = c0.J0(list, new p());
        for (final FindRateResponseOption findRateResponseOption : J0) {
            String Y = Y(findRateResponseOption);
            if (findRateResponseOption.getPrice() <= BitmapDescriptorFactory.HUE_RED) {
                ec.m U = ec.m.U(LayoutInflater.from(getContext()), U().D.E, false);
                U.B.setText(Y);
                View x10 = U.x();
                kotlin.jvm.internal.t.f(x10, "getRoot(...)");
                l0(x10, findRateResponseOption);
                U().D.E.addView(U.x());
            } else {
                final ec.k U2 = ec.k.U(LayoutInflater.from(getContext()), U().D.E, false);
                U2.A.setText(Y);
                U2.A.setChecked(findRateResponseOption.getSelected());
                if (kotlin.jvm.internal.t.b(Y, a0().u0().f())) {
                    new Handler().postDelayed(new Runnable() { // from class: dc.l0
                        @Override // java.lang.Runnable
                        public final void run() {
                            RateDetailsFragment.k0(ec.k.this);
                        }
                    }, 1000L);
                    a0().Q0("");
                }
                U2.A.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { // from class: dc.m0
                    @Override // android.widget.CompoundButton.OnCheckedChangeListener
                    public final void onCheckedChanged(CompoundButton compoundButton, boolean z10) {
                        RateDetailsFragment.j0(RateDetailsFragment.this, findRateResponseOption, compoundButton, z10);
                    }
                });
                U().D.E.addView(U2.x());
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void j0(RateDetailsFragment this$0, FindRateResponseOption option, CompoundButton compoundButton, boolean z10) {
        kotlin.jvm.internal.t.g(this$0, "this$0");
        kotlin.jvm.internal.t.g(option, "$option");
        this$0.a0().O0(option, z10);
        this$0.a0().Q0(compoundButton.getText().toString());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void k0(ec.k it) {
        kotlin.jvm.internal.t.g(it, "$it");
        it.A.performAccessibilityAction(64, null);
        it.A.sendAccessibilityEvent(8);
        it.A.requestFocus();
    }

    private final void l0(View view, FindRateResponseOption findRateResponseOption) {
        view.setContentDescription(Y(findRateResponseOption) + requireActivity().getString(h0.D));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void m0(String str, String str2, String str3) {
        u8.k kVar = new u8.k();
        kVar.v(str);
        kVar.u(str2);
        kVar.n(getString(h0.f16087h1));
        kVar.p(null);
        kVar.o(new q(str3));
        kVar.x(requireContext());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void n0(String str, String str2, String str3) {
        u8.k kVar = new u8.k();
        kVar.v(str);
        kVar.u(str2);
        kVar.n(getString(h0.f16086h0));
        kVar.p(null);
        kVar.o(new r(str3));
        kVar.x(requireContext());
    }

    private final void o0(String str, String str2, String str3) {
        u8.k kVar = new u8.k();
        kVar.v(str);
        kVar.u(str2);
        kVar.p(null);
        kVar.o(new s(str3, this));
        kVar.x(requireContext());
    }

    static /* synthetic */ void p0(RateDetailsFragment rateDetailsFragment, String str, String str2, String str3, int i10, Object obj) {
        if ((i10 & 4) != 0) {
            str3 = null;
        }
        rateDetailsFragment.o0(str, str2, str3);
    }

    public void S(l8.c error, androidx.fragment.app.f fragment) {
        kotlin.jvm.internal.t.g(error, "error");
        kotlin.jvm.internal.t.g(fragment, "fragment");
        this.f9161u.b(error, fragment);
    }

    public void T(l8.h spinnerVM, androidx.fragment.app.f fragment) {
        kotlin.jvm.internal.t.g(spinnerVM, "spinnerVM");
        kotlin.jvm.internal.t.g(fragment, "fragment");
        this.f9160t.b(spinnerVM, fragment);
    }

    public ec.q U() {
        return (ec.q) this.f9159s.b();
    }

    public final t7.c V() {
        t7.c cVar = this.contextService;
        if (cVar != null) {
            return cVar;
        }
        kotlin.jvm.internal.t.y("contextService");
        return null;
    }

    public final ca.a W() {
        ca.a aVar = this.languageService;
        if (aVar != null) {
            return aVar;
        }
        kotlin.jvm.internal.t.y("languageService");
        return null;
    }

    protected final km.t X() {
        km.t tVar = this.moshi;
        if (tVar != null) {
            return tVar;
        }
        kotlin.jvm.internal.t.y("moshi");
        return null;
    }

    protected final n0 Z() {
        n0 n0Var = this.rateDetailsViewModelFactory;
        if (n0Var != null) {
            return n0Var;
        }
        kotlin.jvm.internal.t.y("rateDetailsViewModelFactory");
        return null;
    }

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

    @Override // ca.canadapost.core.common.navigation.ui.d
    public void b(o8.h0 profileNavigationVMHandler, androidx.fragment.app.k activity, boolean z10) {
        kotlin.jvm.internal.t.g(profileNavigationVMHandler, "profileNavigationVMHandler");
        kotlin.jvm.internal.t.g(activity, "activity");
        this.f9162v.b(profileNavigationVMHandler, activity, z10);
    }

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

    public View c0(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState, androidx.lifecycle.u viewLifecycleOwner, z0 viewModel) {
        kotlin.jvm.internal.t.g(inflater, "inflater");
        kotlin.jvm.internal.t.g(viewLifecycleOwner, "viewLifecycleOwner");
        kotlin.jvm.internal.t.g(viewModel, "viewModel");
        return this.f9159s.c(inflater, container, savedInstanceState, viewLifecycleOwner, viewModel);
    }

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

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

    @Override // ca.canadapost.core.common.navigation.ui.d
    public void f(o8.h0 profileNavigationVMHandler, androidx.fragment.app.f fragment, boolean z10) {
        kotlin.jvm.internal.t.g(profileNavigationVMHandler, "profileNavigationVMHandler");
        kotlin.jvm.internal.t.g(fragment, "fragment");
        this.f9162v.f(profileNavigationVMHandler, fragment, z10);
    }

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

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

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

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

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

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

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

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

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

    @Override // u8.b, androidx.fragment.app.f
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        om.a.b(this);
        setHasOptionsMenu(true);
        ArrayAdapter arrayAdapter = new ArrayAdapter(requireContext(), dc.e0.f16037b);
        this.spinnerAdapter = arrayAdapter;
        arrayAdapter.setDropDownViewResource(dc.e0.f16046k);
    }

    @Override // androidx.fragment.app.f
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        kotlin.jvm.internal.t.g(menu, "menu");
        kotlin.jvm.internal.t.g(inflater, "inflater");
        super.onCreateOptionsMenu(menu, inflater);
        inflater.inflate(f0.f16058a, menu);
    }

    @Override // androidx.fragment.app.f
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        kotlin.jvm.internal.t.g(inflater, "inflater");
        androidx.lifecycle.u viewLifecycleOwner = getViewLifecycleOwner();
        kotlin.jvm.internal.t.f(viewLifecycleOwner, "getViewLifecycleOwner(...)");
        return c0(inflater, container, savedInstanceState, viewLifecycleOwner, a0());
    }

    @Override // androidx.fragment.app.f
    public boolean onOptionsItemSelected(MenuItem item) {
        kotlin.jvm.internal.t.g(item, "item");
        if (item.getItemId() != d0.f16031y0) {
            return super.onOptionsItemSelected(item);
        }
        x4.d.a(this).M(d0.f16029x0);
        return true;
    }

    @Override // u8.b, androidx.fragment.app.f
    public void onViewCreated(View view, Bundle bundle) {
        kotlin.jvm.internal.t.g(view, "view");
        androidx.fragment.app.k activity = getActivity();
        if (activity != null) {
            activity.setTitle(getString(h0.f16114t));
        }
        androidx.fragment.app.k activity2 = getActivity();
        kotlin.jvm.internal.t.e(activity2, "null cannot be cast to non-null type ca.canadapost.module.findrate.FindRateActivity");
        Toolbar m02 = ((FindRateActivity) activity2).m0();
        if (m02 != null) {
            m02.setNavigationContentDescription(getString(h0.I0));
        }
        j0.a aVar = j0.f40981a;
        androidx.fragment.app.k requireActivity = requireActivity();
        kotlin.jvm.internal.t.f(requireActivity, "requireActivity(...)");
        aVar.d(requireActivity);
        Spinner spinner = U().D.A;
        ArrayAdapter arrayAdapter = this.spinnerAdapter;
        if (arrayAdapter == null) {
            kotlin.jvm.internal.t.y("spinnerAdapter");
            arrayAdapter = null;
        }
        spinner.setAdapter((SpinnerAdapter) arrayAdapter);
        b0();
        U().B.setOnClickListener(new View.OnClickListener() { // from class: dc.j0
            @Override // android.view.View.OnClickListener
            public final void onClick(View view2) {
                RateDetailsFragment.d0(RateDetailsFragment.this, view2);
            }
        });
        T(a0(), this);
        S(a0(), this);
        d.a.a(this, a0(), this, false, 4, null);
        a0().b0().j(getViewLifecycleOwner(), new n(new f()));
        a0().r0().j(getViewLifecycleOwner(), new n(new g()));
        a0().a0().j(getViewLifecycleOwner(), new n(new h()));
        a0().w0().j(getViewLifecycleOwner(), new n(new i()));
        a0().d0().j(getViewLifecycleOwner(), new n(new j()));
        a0().x0().j(getViewLifecycleOwner(), new n(new k()));
        a0().z0().j(getViewLifecycleOwner(), new n(new l()));
        a0().y0().j(getViewLifecycleOwner(), new n(new m()));
        a0().H0().j(getViewLifecycleOwner(), new n(new d()));
        a0().G0().j(getViewLifecycleOwner(), new n(new e()));
    }

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