package o;

import android.content.Context;
import org.json.JSONException;
import org.json.JSONObject;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.uu, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C2666uu extends Sb0 implements SC {
    public final /* synthetic */ int p;
    public int q;
    public final /* synthetic */ Context r;
    public final /* synthetic */ NC s;
    public final /* synthetic */ InterfaceC1191fR t;
    public final /* synthetic */ InterfaceC1191fR u;
    public final /* synthetic */ InterfaceC1191fR v;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ C2666uu(Context context, NC nc, InterfaceC1191fR interfaceC1191fR, InterfaceC1191fR interfaceC1191fR2, InterfaceC1191fR interfaceC1191fR3, InterfaceC0220Im interfaceC0220Im, int i) {
        super(2, interfaceC0220Im);
        this.p = i;
        this.r = context;
        this.s = nc;
        this.t = interfaceC1191fR;
        this.u = interfaceC1191fR2;
        this.v = interfaceC1191fR3;
    }

    @Override // o.SC
    public final Object f(Object obj, Object obj2) {
        InterfaceC0065Cn interfaceC0065Cn = (InterfaceC0065Cn) obj;
        InterfaceC0220Im interfaceC0220Im = (InterfaceC0220Im) obj2;
        switch (this.p) {
        }
        return ((C2666uu) l(interfaceC0065Cn, interfaceC0220Im)).n(Oh0.a);
    }

    @Override // o.AbstractC0728ad
    public final InterfaceC0220Im l(Object obj, InterfaceC0220Im interfaceC0220Im) {
        switch (this.p) {
            case 0:
                return new C2666uu(this.r, this.s, this.t, this.u, this.v, interfaceC0220Im, 0);
            default:
                return new C2666uu(this.r, this.s, this.t, this.u, this.v, interfaceC0220Im, 1);
        }
    }

    @Override // o.AbstractC0728ad
    public final Object n(Object obj) throws JSONException {
        Object objB;
        Object objB2;
        int i = this.p;
        Oh0 oh0 = Oh0.a;
        NC nc = this.s;
        InterfaceC1191fR interfaceC1191fR = this.v;
        EnumC0091Dn enumC0091Dn = EnumC0091Dn.l;
        InterfaceC1191fR interfaceC1191fR2 = this.t;
        InterfaceC1191fR interfaceC1191fR3 = this.u;
        switch (i) {
            case 0:
                int i2 = this.q;
                if (i2 == 0) {
                    IJ.H(obj);
                    interfaceC1191fR2.setValue(null);
                    interfaceC1191fR3.setValue(Boolean.TRUE);
                    JSONObject jSONObject = Q8.a;
                    C0953cu c0953cu = (C0953cu) interfaceC1191fR.getValue();
                    JSONObject jSONObject2 = new JSONObject();
                    jSONObject2.put("product", "eblaq");
                    jSONObject2.put("fullname", c0953cu.a);
                    jSONObject2.put("meli", c0953cu.b);
                    jSONObject2.put("phone", c0953cu.c);
                    jSONObject2.put("birth_date", c0953cu.d);
                    jSONObject2.put("initial_register", true);
                    String string = jSONObject2.toString();
                    this.q = 1;
                    objB = Q8.b(string, "eblaq_register", this);
                    if (objB == enumC0091Dn) {
                        return enumC0091Dn;
                    }
                } else {
                    if (i2 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    IJ.H(obj);
                    objB = obj;
                }
                boolean zBooleanValue = ((Boolean) objB).booleanValue();
                interfaceC1191fR3.setValue(Boolean.FALSE);
                if (zBooleanValue) {
                    nc.a();
                    return oh0;
                }
                interfaceC1191fR2.setValue("خطا در ارتباط با سرور. لطفاً چند لحظه دیگر دوباره تلاش کنید.");
                return oh0;
            default:
                int i3 = this.q;
                if (i3 == 0) {
                    IJ.H(obj);
                    int i4 = Fi0.h;
                    interfaceC1191fR2.setValue(null);
                    interfaceC1191fR3.setValue(Boolean.TRUE);
                    Ei0 ei0 = (Ei0) interfaceC1191fR.getValue();
                    JSONObject jSONObject3 = new JSONObject();
                    jSONObject3.put("product", "vam_asan");
                    jSONObject3.put("fullname", ei0.a);
                    jSONObject3.put("meli", ei0.b);
                    jSONObject3.put("phone", ei0.c);
                    jSONObject3.put("birth_date", ei0.d);
                    jSONObject3.put("initial_register", false);
                    String string2 = jSONObject3.toString();
                    JSONObject jSONObject4 = Q8.a;
                    this.q = 1;
                    objB2 = Q8.b(string2, "vam_asan_register", this);
                    if (objB2 == enumC0091Dn) {
                        return enumC0091Dn;
                    }
                } else {
                    if (i3 != 1) {
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                    }
                    IJ.H(obj);
                    objB2 = obj;
                }
                boolean zBooleanValue2 = ((Boolean) objB2).booleanValue();
                int i5 = Fi0.h;
                interfaceC1191fR3.setValue(Boolean.FALSE);
                if (zBooleanValue2) {
                    nc.a();
                    return oh0;
                }
                interfaceC1191fR2.setValue("خطا در ارسال اطلاعات به سرور. لطفاً دوباره تلاش کنید.");
                return oh0;
        }
    }
}
