package he;

import android.app.Service;
import com.google.firebase.messaging.RemoteMessage;
import dn.p;
import java.util.Map;
import kotlin.coroutines.jvm.internal.l;
import kotlin.jvm.internal.t;
import rm.n0;
import rm.y;
import tp.a0;
import tp.a1;
import tp.a2;
import tp.i0;
import tp.m0;
import yd.k;

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

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

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

    /* renamed from: c, reason: collision with root package name */
    private final fa.a f21613c;

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

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

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

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

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

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

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(Service service, String str, String str2, vm.d dVar) {
            super(2, dVar);
            this.f21616q = service;
            this.f21617r = str;
            this.f21618s = str2;
        }

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

        @Override // kotlin.coroutines.jvm.internal.a
        public final Object invokeSuspend(Object obj) {
            wm.d.f();
            if (this.f21615p != 0) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            y.b(obj);
            b bVar = new b();
            Service service = this.f21616q;
            String str = this.f21617r;
            String str2 = this.f21618s;
            bVar.h(service);
            if (str == null) {
                str = "";
            }
            bVar.i(str);
            if (str2 == null) {
                str2 = "";
            }
            bVar.g(str2);
            bVar.e("MYMAIL");
            String string = service.getResources().getString(k.f52343e);
            t.f(string, "getString(...)");
            bVar.f(string);
            bVar.j(2);
            return n0.f34904a;
        }

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

    public c(t7.c contextService, ca.a languageService, fa.a myMailRepository) {
        a0 b10;
        t.g(contextService, "contextService");
        t.g(languageService, "languageService");
        t.g(myMailRepository, "myMailRepository");
        this.f21611a = contextService;
        this.f21612b = languageService;
        this.f21613c = myMailRepository;
        i0 b11 = a1.b();
        b10 = a2.b(null, 1, null);
        this.f21614d = tp.n0.a(b11.h(b10));
    }

    @Override // p8.b
    public boolean a(Service service, RemoteMessage message) {
        String e10;
        String f10;
        String d10;
        t.g(service, "service");
        t.g(message, "message");
        if (!t.b(message.getData().get("topicCategory"), "MAILMANAGER")) {
            return false;
        }
        Map<String, String> data = message.getData();
        t.f(data, "getData(...)");
        e10 = d.e(data);
        if (e10 != null) {
            Map<String, String> data2 = message.getData();
            t.f(data2, "getData(...)");
            f10 = d.f(data2);
            Map<String, String> data3 = message.getData();
            t.f(data3, "getData(...)");
            d10 = d.d(data3);
            tp.k.d(this.f21614d, null, null, new a(service, f10, d10, null), 3, null);
        }
        return true;
    }
}
