discord-jadx/app/src/main/java/com/discord/widgets/auth/WidgetAuthCaptcha$onViewBou...

93 lines
4.4 KiB
Java

package com.discord.widgets.auth;
import android.content.Context;
import android.view.View;
import com.discord.app.AppActivity;
import com.discord.utilities.auth.RegistrationFlowRepo;
import com.discord.utilities.captcha.CaptchaHelper;
import com.discord.utilities.error.Error;
import com.discord.utilities.rx.ObservableExtensionsKt;
import d0.z.d.m;
import d0.z.d.o;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
/* compiled from: WidgetAuthCaptcha.kt */
public final class WidgetAuthCaptcha$onViewBound$1 implements View.OnClickListener {
public final /* synthetic */ CaptchaHelper.CaptchaRequest $captchaRequest;
public final /* synthetic */ WidgetAuthCaptcha this$0;
/* compiled from: WidgetAuthCaptcha.kt */
/* renamed from: com.discord.widgets.auth.WidgetAuthCaptcha$onViewBound$1$1 reason: invalid class name */
public static final class AnonymousClass1 extends o implements Function1<String, Unit> {
public final /* synthetic */ WidgetAuthCaptcha$onViewBound$1 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass1(WidgetAuthCaptcha$onViewBound$1 widgetAuthCaptcha$onViewBound$1) {
super(1);
this.this$0 = widgetAuthCaptcha$onViewBound$1;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(String str) {
invoke(str);
return Unit.a;
}
public final void invoke(String str) {
CaptchaHelper.INSTANCE.setCaptchaToken(str);
AppActivity appActivity = this.this$0.this$0.getAppActivity();
if (appActivity != null) {
WidgetAuthCaptcha.access$finishIfCaptchaTokenReceived(this.this$0.this$0, appActivity);
}
}
}
/* compiled from: WidgetAuthCaptcha.kt */
/* renamed from: com.discord.widgets.auth.WidgetAuthCaptcha$onViewBound$1$2 reason: invalid class name */
public static final class AnonymousClass2 extends o implements Function1<Error, Unit> {
public final /* synthetic */ WidgetAuthCaptcha$onViewBound$1 this$0;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public AnonymousClass2(WidgetAuthCaptcha$onViewBound$1 widgetAuthCaptcha$onViewBound$1) {
super(1);
this.this$0 = widgetAuthCaptcha$onViewBound$1;
}
/* Return type fixed from 'java.lang.Object' to match base method */
/* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
@Override // kotlin.jvm.functions.Function1
public /* bridge */ /* synthetic */ Unit invoke(Error error) {
invoke(error);
return Unit.a;
}
public final void invoke(Error error) {
m.checkNotNullParameter(error, "it");
RegistrationFlowRepo.Companion companion = RegistrationFlowRepo.Companion;
RegistrationFlowRepo.trackTransition$default(companion.getINSTANCE(), "Captcha", "submitted", null, 4, null);
companion.getINSTANCE().trackTransition("Captcha", "response_error", d0.t.m.listOf("captcha"));
Throwable throwable = error.getThrowable();
if (!(throwable instanceof CaptchaHelper.Failure)) {
throwable = null;
}
CaptchaHelper.Failure failure = (CaptchaHelper.Failure) throwable;
if (failure != null) {
c.a.d.o.g(this.this$0.this$0.getAppActivity(), failure.getErrorStringId(), 0, null, 12);
}
}
}
public WidgetAuthCaptcha$onViewBound$1(WidgetAuthCaptcha widgetAuthCaptcha, CaptchaHelper.CaptchaRequest captchaRequest) {
this.this$0 = widgetAuthCaptcha;
this.$captchaRequest = captchaRequest;
}
@Override // android.view.View.OnClickListener
public final void onClick(View view) {
ObservableExtensionsKt.appSubscribe$default(CaptchaHelper.INSTANCE.tryShowCaptcha(this.$captchaRequest), this.this$0.getClass(), (Context) null, (Function1) null, new AnonymousClass2(this), (Function0) null, (Function0) null, new AnonymousClass1(this), 54, (Object) null);
}
}