package com.discord.widgets.channels; import android.content.Context; import android.view.MenuItem; import com.discord.api.channel.Channel; import com.discord.restapi.RestAPIParams; import com.discord.utilities.rest.RestAPI; import com.discord.utilities.rx.ObservableExtensionsKt; import com.discord.utilities.view.extensions.ViewExtensions; import com.google.android.material.textfield.TextInputLayout; import d0.z.d.k; import d0.z.d.m; import kotlin.Unit; import kotlin.jvm.functions.Function0; import kotlin.jvm.functions.Function1; import rx.functions.Action2; /* compiled from: WidgetCreateChannel.kt */ public final class WidgetCreateChannel$configureUI$1 implements Action2 { public final /* synthetic */ WidgetCreateChannel this$0; /* compiled from: WidgetCreateChannel.kt */ /* renamed from: com.discord.widgets.channels.WidgetCreateChannel$configureUI$1$1 reason: invalid class name */ public static final /* synthetic */ class AnonymousClass1 extends k implements Function1 { public AnonymousClass1(WidgetCreateChannel widgetCreateChannel) { super(1, widgetCreateChannel, WidgetCreateChannel.class, "onChannelCreated", "onChannelCreated(Lcom/discord/api/channel/Channel;)V", 0); } /* 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(Channel channel) { invoke(channel); return Unit.a; } public final void invoke(Channel channel) { m.checkNotNullParameter(channel, "p1"); WidgetCreateChannel.access$onChannelCreated((WidgetCreateChannel) this.receiver, channel); } } public WidgetCreateChannel$configureUI$1(WidgetCreateChannel widgetCreateChannel) { this.this$0 = widgetCreateChannel; } public final void call(MenuItem menuItem, Context context) { m.checkNotNullParameter(menuItem, "menuItem"); if (menuItem.getItemId() == 2131363998) { RestAPI api = RestAPI.Companion.getApi(); long access$getGuildId$p = WidgetCreateChannel.access$getGuildId$p(this.this$0); int access$getChannelType$p = WidgetCreateChannel.access$getChannelType$p(this.this$0); TextInputLayout textInputLayout = WidgetCreateChannel.access$getBinding$p(this.this$0).d; m.checkNotNullExpressionValue(textInputLayout, "binding.createChannelNameLayout"); ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.restSubscribeOn$default(api.createGuildChannel(access$getGuildId$p, new RestAPIParams.CreateGuildChannel(access$getChannelType$p, null, ViewExtensions.getTextOrEmpty(textInputLayout), WidgetCreateChannel.access$getCategoryId$p(this.this$0), WidgetCreateChannel.access$getPermissionOverwrites(this.this$0), null)), false, 1, null), this.this$0, null, 2, null), this.this$0.getClass(), this.this$0.getContext(), (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass1(this.this$0), 60, (Object) null); } } }