package V2;

import com.google.android.gms.tasks.Task;
import com.google.firebase.firestore.ktx.FirestoreKt;
import com.google.firebase.ktx.Firebase;
import m3.AbstractC2467b;
import w4.C3137A;
import x4.AbstractC3229F;

/* JADX INFO: loaded from: classes.dex */
public final class H3 extends C4.j implements J4.e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public int f7352a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public /* synthetic */ Object f7353b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ String f7354c;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public H3(String str, A4.d dVar) {
        super(2, dVar);
        this.f7354c = str;
    }

    @Override // C4.a
    public final A4.d create(Object obj, A4.d dVar) {
        H3 h32 = new H3(this.f7354c, dVar);
        h32.f7353b = obj;
        return h32;
    }

    @Override // J4.e
    public final Object invoke(Object obj, Object obj2) {
        return ((H3) create((V4.C) obj, (A4.d) obj2)).invokeSuspend(C3137A.f25453a);
    }

    @Override // C4.a
    public final Object invokeSuspend(Object obj) {
        Object objD;
        B4.a aVar = B4.a.f492a;
        int i6 = this.f7352a;
        try {
            if (i6 == 0) {
                AbstractC2467b.l(obj);
                String str = this.f7354c;
                if (S4.p.Q0(str)) {
                    throw new IllegalArgumentException("Not signed in");
                }
                L3 l32 = L3.f7428a;
                Task<Void> task = FirestoreKt.getFirestore(Firebase.INSTANCE).collection("addOns").document(str).set(AbstractC3229F.v(new w4.k("addOns", x4.y.f26065a)));
                kotlin.jvm.internal.o.g(task, "set(...)");
                this.f7352a = 1;
                if (W0.e.h(task, this) == aVar) {
                    return aVar;
                }
            } else {
                if (i6 != 1) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC2467b.l(obj);
            }
            C3.a();
            objD = C3137A.f25453a;
        } catch (Throwable th) {
            objD = AbstractC2467b.d(th);
        }
        return new w4.n(objD);
    }
}
