2022-01-27 07:52:47 +00:00
|
|
|
package com.discord.stores;
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
import com.discord.api.botuikit.ComponentType;
|
|
|
|
import com.discord.api.interaction.InteractionModalCreate;
|
|
|
|
import com.discord.restapi.RestAPIParams;
|
|
|
|
import com.discord.stores.StoreApplicationInteractions;
|
|
|
|
import com.discord.utilities.error.Error;
|
|
|
|
import com.discord.utilities.rest.RestAPI;
|
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import d0.z.d.m;
|
|
|
|
import d0.z.d.o;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Iterator;
|
|
|
|
import java.util.List;
|
|
|
|
import kotlin.Pair;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
|
|
|
/* compiled from: StoreApplicationInteractions.kt */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes.dex */
|
2022-01-27 07:52:47 +00:00
|
|
|
public final class StoreApplicationInteractions$sendModalInteraction$1 extends o implements Function0<Unit> {
|
|
|
|
public final /* synthetic */ List $components;
|
|
|
|
public final /* synthetic */ StoreApplicationInteractions.SentInteraction $localSendData;
|
|
|
|
public final /* synthetic */ InteractionModalCreate $modal;
|
|
|
|
public final /* synthetic */ long $nonce;
|
|
|
|
public final /* synthetic */ Function0 $onError;
|
|
|
|
public final /* synthetic */ Function1 $onNext;
|
|
|
|
public final /* synthetic */ StoreApplicationInteractions this$0;
|
|
|
|
|
|
|
|
/* compiled from: StoreApplicationInteractions.kt */
|
|
|
|
/* renamed from: com.discord.stores.StoreApplicationInteractions$sendModalInteraction$1$2 reason: invalid class name */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes.dex */
|
2022-01-27 07:52:47 +00:00
|
|
|
public static final class AnonymousClass2 extends o implements Function1<Void, Unit> {
|
2022-03-07 09:34:54 +00:00
|
|
|
public AnonymousClass2() {
|
2022-01-27 07:52:47 +00:00
|
|
|
super(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(Void r1) {
|
2022-03-07 09:34:54 +00:00
|
|
|
invoke2(r1);
|
2022-01-27 07:52:47 +00:00
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* renamed from: invoke reason: avoid collision after fix types in other method */
|
|
|
|
public final void invoke2(Void r4) {
|
|
|
|
StoreApplicationInteractions$sendModalInteraction$1 storeApplicationInteractions$sendModalInteraction$1 = StoreApplicationInteractions$sendModalInteraction$1.this;
|
2022-01-27 07:52:47 +00:00
|
|
|
storeApplicationInteractions$sendModalInteraction$1.$onNext.invoke(String.valueOf(storeApplicationInteractions$sendModalInteraction$1.$nonce));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* compiled from: StoreApplicationInteractions.kt */
|
|
|
|
/* renamed from: com.discord.stores.StoreApplicationInteractions$sendModalInteraction$1$3 reason: invalid class name */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes.dex */
|
2022-01-27 07:52:47 +00:00
|
|
|
public static final class AnonymousClass3 extends o implements Function1<Error, Unit> {
|
2022-03-07 09:34:54 +00:00
|
|
|
public AnonymousClass3() {
|
2022-01-27 07:52:47 +00:00
|
|
|
super(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function1
|
|
|
|
public /* bridge */ /* synthetic */ Unit invoke(Error error) {
|
2022-03-07 09:34:54 +00:00
|
|
|
invoke2(error);
|
2022-01-27 07:52:47 +00:00
|
|
|
return Unit.a;
|
|
|
|
}
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* renamed from: invoke reason: avoid collision after fix types in other method */
|
|
|
|
public final void invoke2(Error error) {
|
2022-01-27 07:52:47 +00:00
|
|
|
m.checkNotNullParameter(error, "it");
|
2022-03-07 09:34:54 +00:00
|
|
|
StoreApplicationInteractions$sendModalInteraction$1.this.$onError.invoke();
|
2022-01-27 07:52:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
2022-01-27 07:52:47 +00:00
|
|
|
public StoreApplicationInteractions$sendModalInteraction$1(StoreApplicationInteractions storeApplicationInteractions, InteractionModalCreate interactionModalCreate, StoreApplicationInteractions.SentInteraction sentInteraction, long j, List list, Function1 function1, Function0 function0) {
|
|
|
|
super(0);
|
|
|
|
this.this$0 = storeApplicationInteractions;
|
|
|
|
this.$modal = interactionModalCreate;
|
|
|
|
this.$localSendData = sentInteraction;
|
|
|
|
this.$nonce = j;
|
|
|
|
this.$components = list;
|
|
|
|
this.$onNext = function1;
|
|
|
|
this.$onError = function0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.jvm.functions.Function0
|
2022-03-07 09:34:54 +00:00
|
|
|
/* renamed from: invoke reason: avoid collision after fix types in other method */
|
|
|
|
public final void invoke2() {
|
2022-01-27 07:52:47 +00:00
|
|
|
RestAPI access$getRestAPI$p = StoreApplicationInteractions.access$getRestAPI$p(this.this$0);
|
|
|
|
long id2 = this.$modal.a().getId();
|
|
|
|
long channelId = this.$localSendData.getChannelId();
|
|
|
|
Long guildId = this.$localSendData.getGuildId();
|
|
|
|
long j = this.$nonce;
|
|
|
|
String access$getSessionId$p = StoreApplicationInteractions.access$getSessionId$p(this.this$0);
|
|
|
|
long id3 = this.$modal.getId();
|
|
|
|
String c = this.$modal.c();
|
|
|
|
List list = this.$components;
|
|
|
|
ArrayList arrayList = new ArrayList(d0.t.o.collectionSizeOrDefault(list, 10));
|
|
|
|
Iterator it = list.iterator();
|
|
|
|
while (it.hasNext()) {
|
|
|
|
Pair pair = (Pair) it.next();
|
|
|
|
arrayList.add(new RestAPIParams.ModalInteractionDataComponent(ComponentType.ACTION_ROW, d0.t.m.listOf(new RestAPIParams.ModalInteractionDataComponent(ComponentType.TEXT, null, (String) pair.getFirst(), (String) pair.getSecond())), null, null));
|
|
|
|
it = it;
|
2022-03-18 08:04:35 +00:00
|
|
|
access$getRestAPI$p = access$getRestAPI$p;
|
2022-01-27 07:52:47 +00:00
|
|
|
j = j;
|
|
|
|
access$getSessionId$p = access$getSessionId$p;
|
|
|
|
}
|
2022-03-18 08:04:35 +00:00
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(access$getRestAPI$p.sendModalInteraction(new RestAPIParams.ModalInteraction(5L, id2, null, channelId, guildId, access$getSessionId$p, j, new RestAPIParams.ModalInteractionData(id3, c, arrayList))), false, 1, null), this.this$0.getClass(), (Context) null, (Function1) null, new AnonymousClass3(), (Function0) null, (Function0) null, new AnonymousClass2(), 54, (Object) null);
|
2022-01-27 07:52:47 +00:00
|
|
|
}
|
|
|
|
}
|