package ca.canadapost.module.findrate;

import android.app.Activity;
import android.app.Application;
import android.content.Context;
import androidx.lifecycle.a0;
import androidx.lifecycle.a1;
import androidx.lifecycle.f0;
import ca.canadapost.core.data.findrate.model.Coverage;
import ca.canadapost.core.data.findrate.model.FindRateDataModel;
import ca.canadapost.core.data.findrate.model.FindRateResponse;
import ca.canadapost.core.data.findrate.model.FindRateResponseItem;
import ca.canadapost.core.data.findrate.model.FindRateResponseOption;
import ca.canadapost.core.data.findrate.model.Product;
import ca.canadapost.core.data.model.ResultWrapper;
import ca.canadapost.module.findrate.a;
import com.google.android.gms.maps.model.BitmapDescriptorFactory;
import d9.f;
import dn.p;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import kn.l;
import kotlin.jvm.internal.g0;
import kotlin.jvm.internal.k;
import kotlin.jvm.internal.p0;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.u0;
import l8.h;
import l8.i;
import n8.f;
import o8.h0;
import o8.i0;
import rm.n0;
import rm.y;
import sm.c0;
import tp.m0;
import tp.o0;
import tp.u1;

/* loaded from: classes4.dex */
public final class c extends androidx.lifecycle.b implements h, l8.c, h0 {
    private final a0 A;
    private final String A0;
    private final f0 B;
    private final a0 C;
    private final f0 D;
    private final a0 E;
    private final f0 F;
    private final a0 G;
    private final f0 H;
    private final a0 I;
    private final f0 J;
    private final a0 K;
    private final f0 L;
    private final a0 M;
    private final f0 N;
    private final a0 O;
    private final f0 P;
    private final a0 Q;
    private final f0 R;
    private final a0 S;
    private final f0 T;
    private final a0 U;
    private final f0 V;
    private final a0 W;
    private final f0 X;
    private final a0 Y;
    private final f0 Z;

    /* renamed from: a0, reason: collision with root package name */
    private final a0 f9280a0;

    /* renamed from: b0, reason: collision with root package name */
    private final f0 f9281b0;

    /* renamed from: c, reason: collision with root package name */
    private final d9.f f9282c;

    /* renamed from: c0, reason: collision with root package name */
    private final a0 f9283c0;

    /* renamed from: d, reason: collision with root package name */
    private final ca.a f9284d;

    /* renamed from: d0, reason: collision with root package name */
    private final f0 f9285d0;

    /* renamed from: e, reason: collision with root package name */
    private final s9.c f9286e;

    /* renamed from: e0, reason: collision with root package name */
    private final a0 f9287e0;

    /* renamed from: f, reason: collision with root package name */
    private final t7.c f9288f;

    /* renamed from: f0, reason: collision with root package name */
    private final f0 f9289f0;

    /* renamed from: g, reason: collision with root package name */
    private FindRateResponseItem f9290g;

    /* renamed from: g0, reason: collision with root package name */
    private final a0 f9291g0;

    /* renamed from: h, reason: collision with root package name */
    private final FindRateDataModel f9292h;

    /* renamed from: h0, reason: collision with root package name */
    private final f0 f9293h0;

    /* renamed from: i, reason: collision with root package name */
    private final p9.h f9294i;

    /* renamed from: i0, reason: collision with root package name */
    private final a0 f9295i0;

    /* renamed from: j, reason: collision with root package name */
    private final g9.d f9296j;

    /* renamed from: j0, reason: collision with root package name */
    private final f0 f9297j0;

    /* renamed from: k, reason: collision with root package name */
    private final /* synthetic */ i f9298k;

    /* renamed from: k0, reason: collision with root package name */
    private final a0 f9299k0;

    /* renamed from: l, reason: collision with root package name */
    private final /* synthetic */ l8.d f9300l;

    /* renamed from: l0, reason: collision with root package name */
    private final f0 f9301l0;

    /* renamed from: m, reason: collision with root package name */
    private final /* synthetic */ i0 f9302m;

    /* renamed from: m0, reason: collision with root package name */
    private final a0 f9303m0;

    /* renamed from: n, reason: collision with root package name */
    private final f0 f9304n;

    /* renamed from: n0, reason: collision with root package name */
    private final l8.g f9305n0;

    /* renamed from: o, reason: collision with root package name */
    private final a0 f9306o;

    /* renamed from: o0, reason: collision with root package name */
    private final a0 f9307o0;

    /* renamed from: p, reason: collision with root package name */
    private final f0 f9308p;

    /* renamed from: p0, reason: collision with root package name */
    private final l8.g f9309p0;

    /* renamed from: q, reason: collision with root package name */
    private final a0 f9310q;

    /* renamed from: q0, reason: collision with root package name */
    private final a0 f9311q0;

    /* renamed from: r, reason: collision with root package name */
    private final f0 f9312r;

    /* renamed from: r0, reason: collision with root package name */
    private final l8.g f9313r0;

    /* renamed from: s, reason: collision with root package name */
    private final a0 f9314s;

    /* renamed from: s0, reason: collision with root package name */
    private final a0 f9315s0;

    /* renamed from: t, reason: collision with root package name */
    private final f0 f9316t;

    /* renamed from: t0, reason: collision with root package name */
    private final l8.g f9317t0;

    /* renamed from: u, reason: collision with root package name */
    private final a0 f9318u;

    /* renamed from: u0, reason: collision with root package name */
    private final a0 f9319u0;

    /* renamed from: v, reason: collision with root package name */
    private final f0 f9320v;

    /* renamed from: v0, reason: collision with root package name */
    private final f0 f9321v0;

    /* renamed from: w, reason: collision with root package name */
    private final a0 f9322w;

    /* renamed from: w0, reason: collision with root package name */
    private final a0 f9323w0;

    /* renamed from: x, reason: collision with root package name */
    private final f0 f9324x;

    /* renamed from: x0, reason: collision with root package name */
    private final f0 f9325x0;

    /* renamed from: y, reason: collision with root package name */
    private final a0 f9326y;

    /* renamed from: y0, reason: collision with root package name */
    private final a0 f9327y0;

    /* renamed from: z, reason: collision with root package name */
    private final f0 f9328z;

    /* renamed from: z0, reason: collision with root package name */
    private final l8.e f9329z0;
    static final /* synthetic */ l[] C0 = {p0.h(new g0(c.class, "doubleClickGuard", "getDoubleClickGuard()Z", 0))};
    public static final a B0 = new a(null);

    /* loaded from: classes4.dex */
    public static final class a {
        private a() {
        }

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

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

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

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

        /* renamed from: s, reason: collision with root package name */
        final /* synthetic */ Float f9333s;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        b(List list, Float f10, vm.d dVar) {
            super(2, dVar);
            this.f9332r = list;
            this.f9333s = f10;
        }

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

        /* JADX WARN: Code restructure failed: missing block: B:10:0x007c, code lost:
        
            if (r11 == null) goto L25;
         */
        @Override // kotlin.coroutines.jvm.internal.a
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public final Object invokeSuspend(Object obj) {
            Object f10;
            FindRateResponseItem findRateResponseItem;
            Object e02;
            f10 = wm.d.f();
            int i10 = this.f9330p;
            if (i10 == 0) {
                y.b(obj);
                s9.c cVar = c.this.f9286e;
                FindRateDataModel findRateDataModel = c.this.f9292h;
                String c10 = c.this.f9284d.c();
                Product product = c.this.f9290g.getProduct();
                String id2 = product != null ? product.getId() : null;
                List list = this.f9332r;
                Float f11 = this.f9333s;
                Integer c11 = f11 != null ? kotlin.coroutines.jvm.internal.b.c((int) f11.floatValue()) : null;
                this.f9330p = 1;
                obj = cVar.c(findRateDataModel, c10, id2, list, c11, this);
                if (obj == f10) {
                    return f10;
                }
            } else {
                if (i10 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                y.b(obj);
            }
            ResultWrapper resultWrapper = (ResultWrapper) obj;
            if (resultWrapper instanceof ResultWrapper.Success) {
                c cVar2 = c.this;
                List<FindRateResponseItem> delRateStd = ((FindRateResponse) ((ResultWrapper.Success) resultWrapper).getData()).getDelRateStd();
                if (delRateStd != null) {
                    e02 = c0.e0(delRateStd);
                    findRateResponseItem = (FindRateResponseItem) e02;
                }
                findRateResponseItem = c.this.f9290g;
                cVar2.S0(findRateResponseItem);
            } else if (resultWrapper instanceof ResultWrapper.Error) {
                c.this.E0((ResultWrapper.Error) resultWrapper, true);
            }
            return n0.f34904a;
        }

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

    /* JADX WARN: Code restructure failed: missing block: B:12:0x021a, code lost:
    
        r3 = kotlin.text.y.J(r7, " ", "", false, 4, null);
     */
    /* JADX WARN: Code restructure failed: missing block: B:14:0x0227, code lost:
    
        r1 = kotlin.text.b0.i1(r3, 3);
     */
    /* JADX WARN: Code restructure failed: missing block: B:3:0x01d5, code lost:
    
        r4 = kotlin.text.y.J(r8, " ", "", false, 4, null);
     */
    /* JADX WARN: Code restructure failed: missing block: B:5:0x01e2, code lost:
    
        r4 = kotlin.text.b0.i1(r4, 3);
     */
    /* JADX WARN: Illegal instructions before constructor call */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public c(d9.f analyticsService, ca.a languageService, s9.c rateRepository, t7.c contextService, FindRateResponseItem findRateResponseItem, FindRateDataModel findRateDataModel, p9.h featureFlagRepository, g9.d sessionRepository) {
        super((Application) r9);
        String string;
        String J;
        List i12;
        String J2;
        List i13;
        t.g(analyticsService, "analyticsService");
        t.g(languageService, "languageService");
        t.g(rateRepository, "rateRepository");
        t.g(contextService, "contextService");
        t.g(findRateResponseItem, "findRateResponseItem");
        t.g(findRateDataModel, "findRateDataModel");
        t.g(featureFlagRepository, "featureFlagRepository");
        t.g(sessionRepository, "sessionRepository");
        Context a10 = contextService.a();
        t.e(a10, "null cannot be cast to non-null type android.app.Application");
        this.f9282c = analyticsService;
        this.f9284d = languageService;
        this.f9286e = rateRepository;
        this.f9288f = contextService;
        this.f9290g = findRateResponseItem;
        this.f9292h = findRateDataModel;
        this.f9294i = featureFlagRepository;
        this.f9296j = sessionRepository;
        this.f9298k = new i(contextService);
        this.f9300l = new l8.d();
        this.f9302m = new i0(analyticsService, sessionRepository);
        f0 f0Var = new f0();
        this.f9304n = f0Var;
        this.f9306o = f0Var;
        f0 f0Var2 = new f0();
        this.f9308p = f0Var2;
        this.f9310q = f0Var2;
        f0 f0Var3 = new f0();
        this.f9312r = f0Var3;
        this.f9314s = f0Var3;
        f0 f0Var4 = new f0();
        this.f9316t = f0Var4;
        this.f9318u = f0Var4;
        f0 f0Var5 = new f0();
        this.f9320v = f0Var5;
        this.f9322w = f0Var5;
        f0 f0Var6 = new f0();
        this.f9324x = f0Var6;
        this.f9326y = f0Var6;
        f0 f0Var7 = new f0();
        this.f9328z = f0Var7;
        this.A = f0Var7;
        f0 f0Var8 = new f0();
        this.B = f0Var8;
        this.C = f0Var8;
        f0 f0Var9 = new f0();
        this.D = f0Var9;
        this.E = f0Var9;
        f0 f0Var10 = new f0();
        this.F = f0Var10;
        this.G = f0Var10;
        f0 f0Var11 = new f0();
        this.H = f0Var11;
        this.I = f0Var11;
        f0 f0Var12 = new f0();
        this.J = f0Var12;
        this.K = f0Var12;
        f0 f0Var13 = new f0();
        this.L = f0Var13;
        this.M = f0Var13;
        f0 f0Var14 = new f0();
        this.N = f0Var14;
        this.O = f0Var14;
        f0 f0Var15 = new f0();
        this.P = f0Var15;
        this.Q = f0Var15;
        f0 f0Var16 = new f0();
        this.R = f0Var16;
        this.S = f0Var16;
        f0 f0Var17 = new f0();
        this.T = f0Var17;
        this.U = f0Var17;
        f0 f0Var18 = new f0();
        this.V = f0Var18;
        this.W = f0Var18;
        f0 f0Var19 = new f0();
        this.X = f0Var19;
        this.Y = f0Var19;
        f0 f0Var20 = new f0();
        this.Z = f0Var20;
        this.f9280a0 = f0Var20;
        f0 f0Var21 = new f0();
        this.f9281b0 = f0Var21;
        this.f9283c0 = f0Var21;
        f0 f0Var22 = new f0();
        this.f9285d0 = f0Var22;
        this.f9287e0 = f0Var22;
        f0 f0Var23 = new f0();
        this.f9289f0 = f0Var23;
        this.f9291g0 = f0Var23;
        f0 f0Var24 = new f0();
        this.f9293h0 = f0Var24;
        this.f9295i0 = f0Var24;
        f0 f0Var25 = new f0();
        this.f9297j0 = f0Var25;
        this.f9299k0 = f0Var25;
        f0 f0Var26 = new f0("");
        this.f9301l0 = f0Var26;
        this.f9303m0 = f0Var26;
        l8.g gVar = new l8.g();
        this.f9305n0 = gVar;
        this.f9307o0 = gVar;
        l8.g gVar2 = new l8.g();
        this.f9309p0 = gVar2;
        this.f9311q0 = gVar2;
        l8.g gVar3 = new l8.g();
        this.f9313r0 = gVar3;
        this.f9315s0 = gVar3;
        l8.g gVar4 = new l8.g();
        this.f9317t0 = gVar4;
        this.f9319u0 = gVar4;
        Boolean bool = Boolean.FALSE;
        f0 f0Var27 = new f0(bool);
        this.f9321v0 = f0Var27;
        this.f9323w0 = f0Var27;
        f0 f0Var28 = new f0(bool);
        this.f9325x0 = f0Var28;
        this.f9327y0 = f0Var28;
        this.f9329z0 = new l8.e(false, 0L, 3, null);
        Float valueOf = Float.valueOf(BitmapDescriptorFactory.HUE_RED);
        f0Var5.q(valueOf);
        f0Var11.q(valueOf);
        f0Var14.q(valueOf);
        f0Var12.q(valueOf);
        f0Var13.q(valueOf);
        f0Var15.q(valueOf);
        f0Var16.q(valueOf);
        f0Var17.q(valueOf);
        String str = null;
        f0Var18.q(null);
        f.a.c(analyticsService, "FARStep4", null, 2, null);
        f.a.c(analyticsService, "FARPickCoverage", null, 2, null);
        String str2 = findRateDataModel.originPostalCode;
        String m02 = (str2 == null || J2 == null || i13 == null) ? null : c0.m0(i13, " ", null, null, 0, null, null, 62, null);
        f0Var7.q(m02);
        f0Var8.q(findRateDataModel.destinationPostalCode);
        if (t.b(findRateDataModel.destinationCountry, x8.a.CANADA.getCode())) {
            String str3 = (String) f0Var8.f();
            if (str3 != null && J != null && i12 != null) {
                str = c0.m0(i12, " ", null, null, 0, null, null, 62, null);
            }
            f0Var8.q(str);
        }
        f0Var9.q(findRateDataModel.isLetter ? a.b.LETTER_OR_DOCUMENT : a.b.PARCEL);
        S0(this.f9290g);
        P0();
        if (featureFlagRepository.d(p9.a.CARBON_CALCULATOR_REVAMP)) {
            string = contextService.getString(dc.h0.P);
            t.f(string, "getString(...)");
        } else {
            string = contextService.getString(dc.h0.M);
            t.f(string, "getString(...)");
        }
        this.A0 = string;
    }

    private final void P0() {
        String str;
        t7.c cVar = this.f9288f;
        int i10 = dc.h0.R;
        cVar.d(i10, this.f9320v.f());
        dc.d dVar = (dc.d) this.f9324x.f();
        if (dVar != null) {
            if (dVar.a() == 1 && dVar.b()) {
                this.f9288f.getString(dc.h0.F);
            } else if (dVar.a() >= 1) {
                this.f9288f.a().getResources().getQuantityString(dc.g0.f16061a, dVar.a(), Integer.valueOf(dVar.a()));
            }
            if (dVar.c()) {
                this.f9288f.getString(dc.h0.f16107p0);
            }
        }
        String str2 = null;
        if (this.B.f() == null) {
            u0 u0Var = u0.f26205a;
            String string = this.f9288f.getString(dc.h0.R0);
            t.f(string, "getString(...)");
            Object[] objArr = new Object[1];
            String str3 = (String) this.f9328z.f();
            if (str3 != null) {
                Locale locale = Locale.getDefault();
                t.f(locale, "getDefault(...)");
                str2 = str3.toUpperCase(locale);
                t.f(str2, "toUpperCase(...)");
            }
            objArr[0] = str2;
            t.f(String.format(string, Arrays.copyOf(objArr, 1)), "format(...)");
        } else {
            u0 u0Var2 = u0.f26205a;
            String string2 = this.f9288f.getString(dc.h0.S0);
            t.f(string2, "getString(...)");
            Object[] objArr2 = new Object[2];
            String str4 = (String) this.f9328z.f();
            if (str4 != null) {
                Locale locale2 = Locale.getDefault();
                t.f(locale2, "getDefault(...)");
                str = str4.toUpperCase(locale2);
                t.f(str, "toUpperCase(...)");
            } else {
                str = null;
            }
            objArr2[0] = str;
            String str5 = (String) this.B.f();
            if (str5 != null) {
                Locale locale3 = Locale.getDefault();
                t.f(locale3, "getDefault(...)");
                str2 = str5.toUpperCase(locale3);
                t.f(str2, "toUpperCase(...)");
            }
            objArr2[1] = str2;
            t.f(String.format(string2, Arrays.copyOf(objArr2, 2)), "format(...)");
        }
        if (this.D.f() == a.b.PARCEL) {
            this.f9288f.getString(dc.h0.f16112s);
        } else {
            this.f9288f.getString(dc.h0.f16106p);
        }
        this.X.q(this.f9288f.getString(dc.h0.f16064a) + this.f9288f.d(i10, this.H.f()));
        this.Z.q(this.f9288f.getString(dc.h0.H) + this.f9288f.d(i10, this.N.f()));
        this.f9281b0.q(this.f9288f.getString(dc.h0.f16067b) + this.f9288f.d(i10, this.J.f()));
        this.f9285d0.q(this.f9288f.getString(dc.h0.G) + this.f9288f.d(i10, this.P.f()));
        this.f9289f0.q(this.f9288f.getString(dc.h0.E) + this.f9288f.d(i10, this.L.f()));
        this.f9293h0.q(this.f9288f.getString(dc.h0.f16111r0) + this.f9288f.d(i10, this.R.f()));
        this.f9297j0.q(this.f9288f.getString(dc.h0.J) + this.f9288f.d(i10, this.T.f()));
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void S0(FindRateResponseItem findRateResponseItem) {
        String str;
        Object f02;
        Boolean carbonNeutral;
        Boolean mostFuelEfficient;
        this.f9290g = findRateResponseItem;
        Product product = findRateResponseItem.getProduct();
        if (product != null && (mostFuelEfficient = product.getMostFuelEfficient()) != null) {
            this.f9304n.q(Boolean.valueOf(mostFuelEfficient.booleanValue()));
        }
        Product product2 = this.f9290g.getProduct();
        if (product2 != null && (carbonNeutral = product2.getCarbonNeutral()) != null) {
            this.f9308p.q(Boolean.valueOf(carbonNeutral.booleanValue()));
        }
        f0 f0Var = this.f9312r;
        Product product3 = this.f9290g.getProduct();
        f0Var.q(product3 != null ? new BigDecimal(String.valueOf(product3.getEmissionDetails())) : null);
        Product product4 = this.f9290g.getProduct();
        List<String> names = product4 != null ? product4.getNames() : null;
        f0 f0Var2 = this.f9316t;
        if (names != null) {
            f02 = c0.f0(names, this.f9284d.e());
            str = (String) f02;
        } else {
            str = null;
        }
        f0Var2.q(str);
        this.f9320v.q(Float.valueOf(this.f9290g.getTotal()));
        this.f9324x.q(new dc.d(this.f9290g.getMaxDays(), this.f9290g.getAmDelivery(), this.f9290g.getGuaranteed()));
        this.F.q(this.f9290g.getOptions());
        this.H.q(Float.valueOf(this.f9290g.getBasePrice()));
        this.N.q(Float.valueOf(this.f9290g.getOversizeFee()));
        this.L.q(Float.valueOf(this.f9290g.getFuelSurcharge()));
        this.P.q(Float.valueOf(this.f9290g.getOptionsTotal()));
        this.R.q(Float.valueOf(this.f9290g.getTax()));
        this.T.q(Float.valueOf(this.f9290g.getTotal()));
        Coverage coverage = this.f9290g.getCoverage();
        if (coverage != null) {
            f0 f0Var3 = this.J;
            Coverage coverage2 = this.f9290g.getCoverage();
            f0Var3.q(coverage2 != null ? Float.valueOf(coverage2.getPrice()) : null);
            if (coverage.getApplicable()) {
                Coverage.IncludedCoverage includedCoverage = coverage.getIncludedCoverage();
                float value = includedCoverage != null ? includedCoverage.getValue() : BitmapDescriptorFactory.HUE_RED;
                Coverage.Qualifier qualifier = coverage.getQualifier();
                if (qualifier != null) {
                    this.V.q(new dc.i0(coverage.getChosenValue(), V(value, qualifier.getMaximumValue(), qualifier.getCoverageUnit()), qualifier.getPricePerUnit(), qualifier.getCoverageUnit(), qualifier.getMaximumValue()));
                }
            } else {
                this.V.q(null);
            }
        }
        P0();
    }

    private final List V(float f10, int i10, int i11) {
        float f11 = (i10 - f10) / i11;
        ArrayList arrayList = new ArrayList();
        int i12 = (int) f11;
        if (i12 >= 0) {
            int i13 = 0;
            while (true) {
                arrayList.add(Float.valueOf((i13 * i11) + f10));
                if (i13 == i12) {
                    break;
                }
                i13++;
            }
        }
        return arrayList;
    }

    private final boolean c0() {
        return this.f9329z0.a(this, C0[0]).booleanValue();
    }

    private final void p0(List list, Float f10) {
        h.a.a(this, a1.a(this), null, null, null, new b(list, f10, null), 7, null);
    }

    public final a0 A0() {
        return this.S;
    }

    public final a0 B0() {
        return this.f9295i0;
    }

    public final a0 C0() {
        return this.f9299k0;
    }

    public final a0 D0() {
        return this.U;
    }

    public void E0(ResultWrapper.Error error, boolean z10) {
        t.g(error, "error");
        this.f9300l.a(error, z10);
    }

    public final void F0(dn.l handleNavigation) {
        t.g(handleNavigation, "handleNavigation");
        handleNavigation.invoke(Boolean.valueOf(this.f9294i.d(p9.a.CARBON_CALCULATOR_REVAMP)));
    }

    public final a0 G0() {
        return this.f9327y0;
    }

    public final a0 H0() {
        return this.f9323w0;
    }

    public final void I0() {
        if (c0()) {
            return;
        }
        this.f9282c.b("Emissionsfromshipping_link_info_click_adobe", d9.e.f15943f.a("FARPickCoverage"));
        this.f9305n0.s();
    }

    @Override // l8.h
    public a0 J() {
        return this.f9298k.J();
    }

    public final void J0() {
        if (c0()) {
            return;
        }
        this.f9282c.b("Carbon-neutralshipping_link_info_click_adobe", d9.e.f15943f.a("FARPickCoverage"));
        this.f9309p0.s();
    }

    /* JADX WARN: Code restructure failed: missing block: B:27:0x006a, code lost:
    
        r0 = sm.c0.S0(r0);
     */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void K0(float f10) {
        List S0;
        Coverage.IncludedCoverage includedCoverage;
        Coverage coverage = this.f9290g.getCoverage();
        if (coverage != null && Float.compare((float) coverage.getChosenValue(), f10) == 0) {
            return;
        }
        Coverage coverage2 = this.f9290g.getCoverage();
        if ((coverage2 == null || (includedCoverage = coverage2.getIncludedCoverage()) == null || Float.compare(includedCoverage.getValue(), f10) != 0) ? false : true) {
            Coverage coverage3 = this.f9290g.getCoverage();
            if (coverage3 != null && t.i(coverage3.getChosenValue(), 0) == 0) {
                return;
            } else {
                f10 = BitmapDescriptorFactory.HUE_RED;
            }
        }
        String string = this.f9288f.getString(dc.h0.f16067b);
        t.f(string, "getString(...)");
        Q0(string);
        List list = (List) this.F.f();
        if (list == null || S0 == null) {
            return;
        }
        p0(S0, Float.valueOf(f10));
    }

    public final void L0() {
        f.a aVar = n8.f.f29853a;
        Activity b10 = this.f9288f.b();
        t.f(b10, "getCurrentActivity(...)");
        aVar.a(b10);
    }

    public final void M0() {
        if (c0()) {
            return;
        }
        this.f9313r0.s();
    }

    public final void N0() {
        if (c0()) {
            return;
        }
        this.f9317t0.s();
    }

    public final void O0(FindRateResponseOption optionItem, boolean z10) {
        t.g(optionItem, "optionItem");
        List list = (List) this.F.f();
        if (list == null) {
            return;
        }
        ArrayList arrayList = new ArrayList();
        Iterator it = list.iterator();
        while (it.hasNext()) {
            arrayList.add(FindRateResponseOption.copy$default((FindRateResponseOption) it.next(), null, null, false, false, false, BitmapDescriptorFactory.HUE_RED, 63, null));
        }
        int size = list.size();
        for (int i10 = 0; i10 < size; i10++) {
            if (t.b(((FindRateResponseOption) arrayList.get(i10)).getCode(), optionItem.getCode()) && ((FindRateResponseOption) arrayList.get(i10)).getSelected() != z10) {
                ((FindRateResponseOption) arrayList.get(i10)).setSelected(z10);
                dc.i0 i0Var = (dc.i0) this.V.f();
                Float valueOf = i0Var != null ? Float.valueOf(i0Var.a()) : null;
                p0(arrayList, Float.valueOf(valueOf != null ? valueOf.floatValue() : BitmapDescriptorFactory.HUE_RED));
                if (t.b(optionItem.getCode(), "UP")) {
                    this.f9321v0.q(Boolean.valueOf(z10));
                }
                if (t.b(optionItem.getCode(), "CYL")) {
                    this.f9325x0.q(Boolean.valueOf(z10));
                    return;
                }
                return;
            }
        }
    }

    public final void Q0(String keyStr) {
        t.g(keyStr, "keyStr");
        this.f9301l0.q(keyStr);
    }

    public final boolean R0() {
        Object f10 = this.f9321v0.f();
        Boolean bool = Boolean.TRUE;
        if (!t.b(f10, bool) && !t.b(this.f9325x0.f(), bool)) {
            Float f11 = (Float) this.N.f();
            if (f11 == null) {
                f11 = Float.valueOf(BitmapDescriptorFactory.HUE_RED);
            }
            if (f11.floatValue() <= BitmapDescriptorFactory.HUE_RED) {
                return true;
            }
        }
        return false;
    }

    public final a0 W() {
        return this.I;
    }

    public final a0 X() {
        return this.f9310q;
    }

    public final String Y() {
        return this.A0;
    }

    public final a0 Z() {
        return this.K;
    }

    public final a0 a0() {
        return this.W;
    }

    public final a0 b0() {
        return this.f9326y;
    }

    public final a0 d0() {
        return this.f9314s;
    }

    public final a0 e0() {
        return this.M;
    }

    public final a0 f0() {
        return this.f9291g0;
    }

    public final a0 g0() {
        return this.E;
    }

    public final a0 h0() {
        return this.f9283c0;
    }

    public final a0 i0() {
        return this.f9306o;
    }

    public final a0 j0() {
        return this.f9287e0;
    }

    public final a0 k0() {
        return this.Q;
    }

    public final a0 l0() {
        return this.O;
    }

    public final a0 m0() {
        return this.f9280a0;
    }

    public final a0 n0() {
        return this.C;
    }

    @Override // l8.c
    public a0 o() {
        return this.f9300l.o();
    }

    public final a0 o0() {
        return this.A;
    }

    public final a0 q0() {
        return this.f9322w;
    }

    public final a0 r0() {
        return this.G;
    }

    public final a0 s0() {
        return this.f9318u;
    }

    @Override // l8.c
    public a0 t() {
        return this.f9300l.t();
    }

    public final a0 t0() {
        return this.Y;
    }

    @Override // l8.h
    public u1 u(m0 m0Var, vm.g context, o0 start, String str, p block) {
        t.g(m0Var, "<this>");
        t.g(context, "context");
        t.g(start, "start");
        t.g(block, "block");
        return this.f9298k.u(m0Var, context, start, str, block);
    }

    public final a0 u0() {
        return this.f9303m0;
    }

    @Override // o8.h0
    public a0 v() {
        return this.f9302m.v();
    }

    public final boolean v0() {
        BigDecimal bigDecimal = (BigDecimal) this.f9314s.f();
        if (bigDecimal == null) {
            bigDecimal = BigDecimal.ZERO;
        }
        return bigDecimal.compareTo(BigDecimal.ZERO) > 0;
    }

    public final a0 w0() {
        return this.f9307o0;
    }

    public final a0 x0() {
        return this.f9311q0;
    }

    public final a0 y0() {
        return this.f9319u0;
    }

    public final a0 z0() {
        return this.f9315s0;
    }
}
