package defpackage;

import android.widget.Toast;
import com.strmr.ps.data.local.entity.RealDebridAccount;
import com.strmr.ps.ui.mobile.settings.MobileAccountsFragment;
import defpackage.q38;
import kotlin.Metadata;
import kotlin.coroutines.Continuation;
import kotlin.coroutines.jvm.internal.DebugMetadata;
import kotlin.coroutines.jvm.internal.SuspendLambda;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lak1;", "Le6a;", "<anonymous>", "(Lak1;)V"}, k = 3, mv = {2, 0, 0})
@DebugMetadata(c = "com.strmr.ps.ui.mobile.settings.MobileAccountsFragment$verifyRealDebridApiKey$1", f = "MobileAccountsFragment.kt", i = {}, l = {926}, m = "invokeSuspend", n = {}, s = {})
@vx8
final class f06 extends SuspendLambda implements gr3<ak1, Continuation<? super e6a>, Object> {
    public int a;
    public final /* synthetic */ MobileAccountsFragment b;
    public final /* synthetic */ String c;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public f06(MobileAccountsFragment mobileAccountsFragment, String str, Continuation continuation) {
        super(2, continuation);
        this.b = mobileAccountsFragment;
        this.c = str;
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Continuation create(Object obj, Continuation continuation) {
        return new f06(this.b, this.c, continuation);
    }

    @Override // defpackage.gr3
    public final Object invoke(Object obj, Object obj2) {
        return ((f06) create((ak1) obj, (Continuation) obj2)).invokeSuspend(e6a.a);
    }

    @Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
    public final Object invokeSuspend(Object obj) throws Throwable {
        ck1 ck1Var = ck1.a;
        int i = this.a;
        MobileAccountsFragment mobileAccountsFragment = this.b;
        if (i == 0) {
            s38.b(obj);
            wl3 wl3Var = mobileAccountsFragment.f;
            cr4.d(wl3Var);
            wl3Var.b.setVisibility(0);
            m12 m12Var = sc2.a;
            m02 m02Var = m02.c;
            e06 e06Var = new e06(mobileAccountsFragment, this.c, null);
            this.a = 1;
            obj = wj0.f(m02Var, e06Var, this);
            if (obj == ck1Var) {
                return ck1Var;
            }
        } else {
            if (i != 1) {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s38.b(obj);
        }
        Object obj2 = ((q38) obj).a;
        wl3 wl3Var2 = mobileAccountsFragment.f;
        cr4.d(wl3Var2);
        wl3Var2.b.setVisibility(8);
        if (!(obj2 instanceof q38.b)) {
            mobileAccountsFragment.ab = (RealDebridAccount) obj2;
            mobileAccountsFragment.t().setShowDebridLibrary(true);
            mobileAccountsFragment.ad();
            Toast.makeText(mobileAccountsFragment.getContext(), "Real-Debrid connected!", 0).show();
        }
        Throwable thA = q38.a(obj2);
        if (thA != null) {
            n41.aa(mobileAccountsFragment.getContext(), "Failed: ", 0, thA.getMessage());
        }
        return e6a.a;
    }
}
