package na;

import ca.canadapost.core.data.model.CommonErrorResponseException;
import ca.canadapost.core.data.model.CoreConstants;
import ca.canadapost.core.data.model.ResultWrapper;
import ca.canadapost.core.data.selfscan.api.ISelfScanApi;
import ca.canadapost.core.data.selfscan.api.ISelfScanTnCApi;
import dn.l;
import g9.s;
import g9.w;
import ha.f;
import ha.g;
import km.t;
import kotlin.jvm.internal.p0;
import kotlin.jvm.internal.v;
import or.u;

/* loaded from: classes.dex */
public final class a {

    /* renamed from: na.a$a, reason: collision with other inner class name */
    /* loaded from: classes.dex */
    static final class C0682a extends v implements l {

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

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        C0682a(t tVar) {
            super(1);
            this.f29873p = tVar;
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final ResultWrapper.Error invoke(or.t response) {
            kotlin.jvm.internal.t.g(response, "response");
            return g.a(response, this.f29873p, p0.b(CommonErrorResponseException.class));
        }
    }

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

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

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        b(t tVar) {
            super(1);
            this.f29874p = tVar;
        }

        @Override // dn.l
        /* renamed from: a, reason: merged with bridge method [inline-methods] */
        public final ResultWrapper.Error invoke(or.t response) {
            kotlin.jvm.internal.t.g(response, "response");
            return g.a(response, this.f29874p, p0.b(CommonErrorResponseException.class));
        }
    }

    public final ISelfScanApi a(ha.c httpClientBuilderFactory, w tokenInjectInterceptor, s authenticator, jr.a loggingInterceptor, f9.a fireBaseAppCheckInterceptor, t moshi) {
        kotlin.jvm.internal.t.g(httpClientBuilderFactory, "httpClientBuilderFactory");
        kotlin.jvm.internal.t.g(tokenInjectInterceptor, "tokenInjectInterceptor");
        kotlin.jvm.internal.t.g(authenticator, "authenticator");
        kotlin.jvm.internal.t.g(loggingInterceptor, "loggingInterceptor");
        kotlin.jvm.internal.t.g(fireBaseAppCheckInterceptor, "fireBaseAppCheckInterceptor");
        kotlin.jvm.internal.t.g(moshi, "moshi");
        Object b10 = new u.b().c("https://www.canadapost-postescanada.ca/mgw/").b(qr.a.g(moshi)).g(httpClientBuilderFactory.a().a(fireBaseAppCheckInterceptor).a(tokenInjectInterceptor).c(authenticator).a(loggingInterceptor).d()).a(new f(new C0682a(moshi))).e().b(ISelfScanApi.class);
        kotlin.jvm.internal.t.f(b10, "create(...)");
        return (ISelfScanApi) b10;
    }

    public final ISelfScanTnCApi b(ha.c httpClientBuilderFactory, w tokenInjectInterceptor, s authenticator, jr.a loggingInterceptor, t moshi) {
        kotlin.jvm.internal.t.g(httpClientBuilderFactory, "httpClientBuilderFactory");
        kotlin.jvm.internal.t.g(tokenInjectInterceptor, "tokenInjectInterceptor");
        kotlin.jvm.internal.t.g(authenticator, "authenticator");
        kotlin.jvm.internal.t.g(loggingInterceptor, "loggingInterceptor");
        kotlin.jvm.internal.t.g(moshi, "moshi");
        Object b10 = new u.b().c(CoreConstants.QUICK_DROP_TERMS_AND_CONDITIONS_BASE_URL).b(qr.a.g(moshi)).g(httpClientBuilderFactory.a().a(tokenInjectInterceptor).c(authenticator).a(loggingInterceptor).d()).a(new f(new b(moshi))).e().b(ISelfScanTnCApi.class);
        kotlin.jvm.internal.t.f(b10, "create(...)");
        return (ISelfScanTnCApi) b10;
    }
}
