discord-jadx/app/src/main/java/com/discord/widgets/guildscheduledevent/GuildScheduledEventDetailsV...

606 lines
29 KiB
Java

package com.discord.widgets.guildscheduledevent;
import android.content.Context;
import androidx.core.app.FrameMetricsAggregator;
import c.d.b.a.a;
import c0.z.d.k;
import c0.z.d.m;
import com.discord.api.channel.Channel;
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
import com.discord.app.AppViewModel;
import com.discord.models.guild.Guild;
import com.discord.stores.StoreChannels;
import com.discord.stores.StoreGuildScheduledEvents;
import com.discord.stores.StoreGuilds;
import com.discord.stores.StorePermissions;
import com.discord.stores.StoreStream;
import com.discord.stores.StoreUserSettings;
import com.discord.stores.StoreVoiceChannelSelected;
import com.discord.stores.updates.ObservationDeck;
import com.discord.stores.updates.ObservationDeckProvider;
import com.discord.utilities.rest.RestAPI;
import com.discord.utilities.rx.ObservableExtensionsKt;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import rx.Observable;
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
public final class GuildScheduledEventDetailsViewModel extends AppViewModel<ViewState> {
public static final Companion Companion = new Companion(null);
private final long guildScheduledEventId;
private final StoreGuildScheduledEvents guildScheduledEventsStore;
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
/* renamed from: com.discord.widgets.guildscheduledevent.GuildScheduledEventDetailsViewModel$1 reason: invalid class name */
public static final /* synthetic */ class AnonymousClass1 extends k implements Function1<StoreState, Unit> {
public AnonymousClass1(GuildScheduledEventDetailsViewModel guildScheduledEventDetailsViewModel) {
super(1, guildScheduledEventDetailsViewModel, GuildScheduledEventDetailsViewModel.class, "handleStoreState", "handleStoreState(Lcom/discord/widgets/guildscheduledevent/GuildScheduledEventDetailsViewModel$StoreState;)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(StoreState storeState) {
invoke(storeState);
return Unit.a;
}
public final void invoke(StoreState storeState) {
m.checkNotNullParameter(storeState, "p1");
GuildScheduledEventDetailsViewModel.access$handleStoreState((GuildScheduledEventDetailsViewModel) this.receiver, storeState);
}
}
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
public static final class Companion {
private Companion() {
}
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
public static final /* synthetic */ Observable access$observeStores(Companion companion, long j, ObservationDeck observationDeck, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, StoreUserSettings storeUserSettings, StoreVoiceChannelSelected storeVoiceChannelSelected) {
return companion.observeStores(j, observationDeck, storeGuildScheduledEvents, storeGuilds, storeChannels, storePermissions, storeUserSettings, storeVoiceChannelSelected);
}
private final Observable<StoreState> observeStores(long j, ObservationDeck observationDeck, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, StoreUserSettings storeUserSettings, StoreVoiceChannelSelected storeVoiceChannelSelected) {
return ObservationDeck.connectRx$default(observationDeck, new ObservationDeck.UpdateSource[]{storeGuildScheduledEvents, storeGuilds, storeChannels, storePermissions, storeVoiceChannelSelected}, false, null, null, new GuildScheduledEventDetailsViewModel$Companion$observeStores$1(storeGuildScheduledEvents, j, storeChannels, storeGuilds, storeVoiceChannelSelected, storePermissions, storeUserSettings), 14, null);
}
}
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
public static final class StoreState {
private final boolean canConnect;
private final boolean canShare;
private final boolean canStartEvent;
private final Channel channel;
private final Guild guild;
private final GuildScheduledEvent guildScheduledEvent;
private final boolean isDeveloperMode;
private final boolean isRsvped;
private final Long selectedVoiceChannelId;
public StoreState() {
this(null, null, null, false, false, false, false, null, false, FrameMetricsAggregator.EVERY_DURATION, null);
}
public StoreState(GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, Long l, boolean z6) {
this.guildScheduledEvent = guildScheduledEvent;
this.channel = channel;
this.guild = guild;
this.isRsvped = z2;
this.canShare = z3;
this.canStartEvent = z4;
this.isDeveloperMode = z5;
this.selectedVoiceChannelId = l;
this.canConnect = z6;
}
/* JADX INFO: this call moved to the top of the method (can break code semantics) */
public /* synthetic */ StoreState(GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, Long l, boolean z6, int i, DefaultConstructorMarker defaultConstructorMarker) {
this((i & 1) != 0 ? null : guildScheduledEvent, (i & 2) != 0 ? null : channel, (i & 4) != 0 ? null : guild, (i & 8) != 0 ? false : z2, (i & 16) != 0 ? false : z3, (i & 32) != 0 ? false : z4, (i & 64) != 0 ? false : z5, (i & 128) == 0 ? l : null, (i & 256) == 0 ? z6 : false);
}
public static /* synthetic */ StoreState copy$default(StoreState storeState, GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, Long l, boolean z6, int i, Object obj) {
return storeState.copy((i & 1) != 0 ? storeState.guildScheduledEvent : guildScheduledEvent, (i & 2) != 0 ? storeState.channel : channel, (i & 4) != 0 ? storeState.guild : guild, (i & 8) != 0 ? storeState.isRsvped : z2, (i & 16) != 0 ? storeState.canShare : z3, (i & 32) != 0 ? storeState.canStartEvent : z4, (i & 64) != 0 ? storeState.isDeveloperMode : z5, (i & 128) != 0 ? storeState.selectedVoiceChannelId : l, (i & 256) != 0 ? storeState.canConnect : z6);
}
public final GuildScheduledEvent component1() {
return this.guildScheduledEvent;
}
public final Channel component2() {
return this.channel;
}
public final Guild component3() {
return this.guild;
}
public final boolean component4() {
return this.isRsvped;
}
public final boolean component5() {
return this.canShare;
}
public final boolean component6() {
return this.canStartEvent;
}
public final boolean component7() {
return this.isDeveloperMode;
}
public final Long component8() {
return this.selectedVoiceChannelId;
}
public final boolean component9() {
return this.canConnect;
}
public final StoreState copy(GuildScheduledEvent guildScheduledEvent, Channel channel, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, Long l, boolean z6) {
return new StoreState(guildScheduledEvent, channel, guild, z2, z3, z4, z5, l, z6);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof StoreState)) {
return false;
}
StoreState storeState = (StoreState) obj;
return m.areEqual(this.guildScheduledEvent, storeState.guildScheduledEvent) && m.areEqual(this.channel, storeState.channel) && m.areEqual(this.guild, storeState.guild) && this.isRsvped == storeState.isRsvped && this.canShare == storeState.canShare && this.canStartEvent == storeState.canStartEvent && this.isDeveloperMode == storeState.isDeveloperMode && m.areEqual(this.selectedVoiceChannelId, storeState.selectedVoiceChannelId) && this.canConnect == storeState.canConnect;
}
public final boolean getCanConnect() {
return this.canConnect;
}
public final boolean getCanShare() {
return this.canShare;
}
public final boolean getCanStartEvent() {
return this.canStartEvent;
}
public final Channel getChannel() {
return this.channel;
}
public final Guild getGuild() {
return this.guild;
}
public final GuildScheduledEvent getGuildScheduledEvent() {
return this.guildScheduledEvent;
}
public final Long getSelectedVoiceChannelId() {
return this.selectedVoiceChannelId;
}
public int hashCode() {
GuildScheduledEvent guildScheduledEvent = this.guildScheduledEvent;
int i = 0;
int hashCode = (guildScheduledEvent != null ? guildScheduledEvent.hashCode() : 0) * 31;
Channel channel = this.channel;
int hashCode2 = (hashCode + (channel != null ? channel.hashCode() : 0)) * 31;
Guild guild = this.guild;
int hashCode3 = (hashCode2 + (guild != null ? guild.hashCode() : 0)) * 31;
boolean z2 = this.isRsvped;
int i2 = 1;
if (z2) {
z2 = true;
}
int i3 = z2 ? 1 : 0;
int i4 = z2 ? 1 : 0;
int i5 = z2 ? 1 : 0;
int i6 = (hashCode3 + i3) * 31;
boolean z3 = this.canShare;
if (z3) {
z3 = true;
}
int i7 = z3 ? 1 : 0;
int i8 = z3 ? 1 : 0;
int i9 = z3 ? 1 : 0;
int i10 = (i6 + i7) * 31;
boolean z4 = this.canStartEvent;
if (z4) {
z4 = true;
}
int i11 = z4 ? 1 : 0;
int i12 = z4 ? 1 : 0;
int i13 = z4 ? 1 : 0;
int i14 = (i10 + i11) * 31;
boolean z5 = this.isDeveloperMode;
if (z5) {
z5 = true;
}
int i15 = z5 ? 1 : 0;
int i16 = z5 ? 1 : 0;
int i17 = z5 ? 1 : 0;
int i18 = (i14 + i15) * 31;
Long l = this.selectedVoiceChannelId;
if (l != null) {
i = l.hashCode();
}
int i19 = (i18 + i) * 31;
boolean z6 = this.canConnect;
if (!z6) {
i2 = z6 ? 1 : 0;
}
return i19 + i2;
}
public final boolean isDeveloperMode() {
return this.isDeveloperMode;
}
public final boolean isRsvped() {
return this.isRsvped;
}
public String toString() {
StringBuilder O = a.O("StoreState(guildScheduledEvent=");
O.append(this.guildScheduledEvent);
O.append(", channel=");
O.append(this.channel);
O.append(", guild=");
O.append(this.guild);
O.append(", isRsvped=");
O.append(this.isRsvped);
O.append(", canShare=");
O.append(this.canShare);
O.append(", canStartEvent=");
O.append(this.canStartEvent);
O.append(", isDeveloperMode=");
O.append(this.isDeveloperMode);
O.append(", selectedVoiceChannelId=");
O.append(this.selectedVoiceChannelId);
O.append(", canConnect=");
return a.K(O, this.canConnect, ")");
}
}
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
public static abstract class ViewState {
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
public static final class Initialized extends ViewState {
private final boolean canConnect;
private final boolean canShare;
private final boolean canStartEvent;
private final Guild guild;
private final GuildScheduledEvent guildScheduledEvent;
private final boolean isConnected;
private final boolean isDeveloperMode;
private final boolean isRsvped;
private final GuildScheduledEventLocationInfo locationInfo;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public Initialized(GuildScheduledEvent guildScheduledEvent, GuildScheduledEventLocationInfo guildScheduledEventLocationInfo, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7) {
super(null);
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
m.checkNotNullParameter(guildScheduledEventLocationInfo, "locationInfo");
m.checkNotNullParameter(guild, "guild");
this.guildScheduledEvent = guildScheduledEvent;
this.locationInfo = guildScheduledEventLocationInfo;
this.guild = guild;
this.isRsvped = z2;
this.canShare = z3;
this.isConnected = z4;
this.canStartEvent = z5;
this.isDeveloperMode = z6;
this.canConnect = z7;
}
public static /* synthetic */ Initialized copy$default(Initialized initialized, GuildScheduledEvent guildScheduledEvent, GuildScheduledEventLocationInfo guildScheduledEventLocationInfo, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7, int i, Object obj) {
return initialized.copy((i & 1) != 0 ? initialized.guildScheduledEvent : guildScheduledEvent, (i & 2) != 0 ? initialized.locationInfo : guildScheduledEventLocationInfo, (i & 4) != 0 ? initialized.guild : guild, (i & 8) != 0 ? initialized.isRsvped : z2, (i & 16) != 0 ? initialized.canShare : z3, (i & 32) != 0 ? initialized.isConnected : z4, (i & 64) != 0 ? initialized.canStartEvent : z5, (i & 128) != 0 ? initialized.isDeveloperMode : z6, (i & 256) != 0 ? initialized.canConnect : z7);
}
public final GuildScheduledEvent component1() {
return this.guildScheduledEvent;
}
public final GuildScheduledEventLocationInfo component2() {
return this.locationInfo;
}
public final Guild component3() {
return this.guild;
}
public final boolean component4() {
return this.isRsvped;
}
public final boolean component5() {
return this.canShare;
}
public final boolean component6() {
return this.isConnected;
}
public final boolean component7() {
return this.canStartEvent;
}
public final boolean component8() {
return this.isDeveloperMode;
}
public final boolean component9() {
return this.canConnect;
}
public final Initialized copy(GuildScheduledEvent guildScheduledEvent, GuildScheduledEventLocationInfo guildScheduledEventLocationInfo, Guild guild, boolean z2, boolean z3, boolean z4, boolean z5, boolean z6, boolean z7) {
m.checkNotNullParameter(guildScheduledEvent, "guildScheduledEvent");
m.checkNotNullParameter(guildScheduledEventLocationInfo, "locationInfo");
m.checkNotNullParameter(guild, "guild");
return new Initialized(guildScheduledEvent, guildScheduledEventLocationInfo, guild, z2, z3, z4, z5, z6, z7);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof Initialized)) {
return false;
}
Initialized initialized = (Initialized) obj;
return m.areEqual(this.guildScheduledEvent, initialized.guildScheduledEvent) && m.areEqual(this.locationInfo, initialized.locationInfo) && m.areEqual(this.guild, initialized.guild) && this.isRsvped == initialized.isRsvped && this.canShare == initialized.canShare && this.isConnected == initialized.isConnected && this.canStartEvent == initialized.canStartEvent && this.isDeveloperMode == initialized.isDeveloperMode && this.canConnect == initialized.canConnect;
}
public final boolean getCanConnect() {
return this.canConnect;
}
public final boolean getCanShare() {
return this.canShare;
}
public final boolean getCanStartEvent() {
return this.canStartEvent;
}
public final Guild getGuild() {
return this.guild;
}
public final GuildScheduledEvent getGuildScheduledEvent() {
return this.guildScheduledEvent;
}
public final GuildScheduledEventLocationInfo getLocationInfo() {
return this.locationInfo;
}
public int hashCode() {
GuildScheduledEvent guildScheduledEvent = this.guildScheduledEvent;
int i = 0;
int hashCode = (guildScheduledEvent != null ? guildScheduledEvent.hashCode() : 0) * 31;
GuildScheduledEventLocationInfo guildScheduledEventLocationInfo = this.locationInfo;
int hashCode2 = (hashCode + (guildScheduledEventLocationInfo != null ? guildScheduledEventLocationInfo.hashCode() : 0)) * 31;
Guild guild = this.guild;
if (guild != null) {
i = guild.hashCode();
}
int i2 = (hashCode2 + i) * 31;
boolean z2 = this.isRsvped;
int i3 = 1;
if (z2) {
z2 = true;
}
int i4 = z2 ? 1 : 0;
int i5 = z2 ? 1 : 0;
int i6 = z2 ? 1 : 0;
int i7 = (i2 + i4) * 31;
boolean z3 = this.canShare;
if (z3) {
z3 = true;
}
int i8 = z3 ? 1 : 0;
int i9 = z3 ? 1 : 0;
int i10 = z3 ? 1 : 0;
int i11 = (i7 + i8) * 31;
boolean z4 = this.isConnected;
if (z4) {
z4 = true;
}
int i12 = z4 ? 1 : 0;
int i13 = z4 ? 1 : 0;
int i14 = z4 ? 1 : 0;
int i15 = (i11 + i12) * 31;
boolean z5 = this.canStartEvent;
if (z5) {
z5 = true;
}
int i16 = z5 ? 1 : 0;
int i17 = z5 ? 1 : 0;
int i18 = z5 ? 1 : 0;
int i19 = (i15 + i16) * 31;
boolean z6 = this.isDeveloperMode;
if (z6) {
z6 = true;
}
int i20 = z6 ? 1 : 0;
int i21 = z6 ? 1 : 0;
int i22 = z6 ? 1 : 0;
int i23 = (i19 + i20) * 31;
boolean z7 = this.canConnect;
if (!z7) {
i3 = z7 ? 1 : 0;
}
return i23 + i3;
}
public final boolean isConnected() {
return this.isConnected;
}
public final boolean isDeveloperMode() {
return this.isDeveloperMode;
}
public final boolean isRsvped() {
return this.isRsvped;
}
public String toString() {
StringBuilder O = a.O("Initialized(guildScheduledEvent=");
O.append(this.guildScheduledEvent);
O.append(", locationInfo=");
O.append(this.locationInfo);
O.append(", guild=");
O.append(this.guild);
O.append(", isRsvped=");
O.append(this.isRsvped);
O.append(", canShare=");
O.append(this.canShare);
O.append(", isConnected=");
O.append(this.isConnected);
O.append(", canStartEvent=");
O.append(this.canStartEvent);
O.append(", isDeveloperMode=");
O.append(this.isDeveloperMode);
O.append(", canConnect=");
return a.K(O, this.canConnect, ")");
}
}
/* compiled from: GuildScheduledEventDetailsViewModel.kt */
public static final class Invalid extends ViewState {
public static final Invalid INSTANCE = new Invalid();
private Invalid() {
super(null);
}
}
private ViewState() {
}
public /* synthetic */ ViewState(DefaultConstructorMarker defaultConstructorMarker) {
this();
}
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public GuildScheduledEventDetailsViewModel(long j, ObservationDeck observationDeck, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, StoreUserSettings storeUserSettings, StoreVoiceChannelSelected storeVoiceChannelSelected, Observable<StoreState> observable) {
super(null, 1, null);
m.checkNotNullParameter(observationDeck, "observationDeck");
m.checkNotNullParameter(storeGuildScheduledEvents, "guildScheduledEventsStore");
m.checkNotNullParameter(storeGuilds, "guildsStore");
m.checkNotNullParameter(storeChannels, "channelsStore");
m.checkNotNullParameter(storePermissions, "permissionsStore");
m.checkNotNullParameter(storeUserSettings, "userSettingsStore");
m.checkNotNullParameter(storeVoiceChannelSelected, "selectedVoiceChannelStore");
m.checkNotNullParameter(observable, "storeStateObservable");
this.guildScheduledEventId = j;
this.guildScheduledEventsStore = storeGuildScheduledEvents;
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(ObservableExtensionsKt.computationLatest(observable), this, null, 2, null), GuildScheduledEventDetailsViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass1(this), 62, (Object) null);
}
/* JADX WARNING: Illegal instructions before constructor call */
public /* synthetic */ GuildScheduledEventDetailsViewModel(long j, ObservationDeck observationDeck, StoreGuildScheduledEvents storeGuildScheduledEvents, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, StoreUserSettings storeUserSettings, StoreVoiceChannelSelected storeVoiceChannelSelected, Observable observable, int i, DefaultConstructorMarker defaultConstructorMarker) {
this(j, r5, r6, r7, r8, r9, r10, r11, (i & 256) != 0 ? Companion.access$observeStores(Companion, j, r5, r6, r7, r8, r9, r10, r11) : observable);
ObservationDeck observationDeck2 = (i & 2) != 0 ? ObservationDeckProvider.get() : observationDeck;
StoreGuildScheduledEvents guildScheduledEvents = (i & 4) != 0 ? StoreStream.Companion.getGuildScheduledEvents() : storeGuildScheduledEvents;
StoreGuilds guilds = (i & 8) != 0 ? StoreStream.Companion.getGuilds() : storeGuilds;
StoreChannels channels = (i & 16) != 0 ? StoreStream.Companion.getChannels() : storeChannels;
StorePermissions permissions = (i & 32) != 0 ? StoreStream.Companion.getPermissions() : storePermissions;
StoreUserSettings userSettings = (i & 64) != 0 ? StoreStream.Companion.getUserSettings() : storeUserSettings;
StoreVoiceChannelSelected voiceChannelSelected = (i & 128) != 0 ? StoreStream.Companion.getVoiceChannelSelected() : storeVoiceChannelSelected;
}
public static final /* synthetic */ void access$handleStoreState(GuildScheduledEventDetailsViewModel guildScheduledEventDetailsViewModel, StoreState storeState) {
guildScheduledEventDetailsViewModel.handleStoreState(storeState);
}
private final void handleStoreState(StoreState storeState) {
Object obj;
boolean z2;
if (storeState.getGuildScheduledEvent() == null || storeState.getGuild() == null) {
obj = ViewState.Invalid.INSTANCE;
} else {
if (getViewState() == null) {
this.guildScheduledEventsStore.fetchGuildScheduledEventUserCounts(storeState.getGuild().getId());
}
GuildScheduledEventLocationInfo buildLocationInfo = GuildScheduledEventLocationInfo.Companion.buildLocationInfo(storeState.getGuildScheduledEvent(), storeState.getChannel());
GuildScheduledEvent guildScheduledEvent = storeState.getGuildScheduledEvent();
Guild guild = storeState.getGuild();
boolean isRsvped = storeState.isRsvped();
Long b = storeState.getGuildScheduledEvent().b();
boolean z3 = false;
if (b != null) {
long longValue = b.longValue();
Long selectedVoiceChannelId = storeState.getSelectedVoiceChannelId();
if (selectedVoiceChannelId != null && longValue == selectedVoiceChannelId.longValue()) {
z3 = true;
}
z2 = z3;
} else {
z2 = false;
}
obj = new ViewState.Initialized(guildScheduledEvent, buildLocationInfo, guild, isRsvped, storeState.getCanShare(), z2, storeState.getCanStartEvent(), storeState.isDeveloperMode(), storeState.getCanConnect());
}
updateViewState(obj);
}
public final void endEventClicked(Context context, Function0<Unit> function0) {
m.checkNotNullParameter(context, "context");
m.checkNotNullParameter(function0, "onSuccess");
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Initialized)) {
viewState = null;
}
ViewState.Initialized initialized = (ViewState.Initialized) viewState;
if (initialized != null) {
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(GuildScheduledEventAPI.INSTANCE.endEvent(initialized.getGuildScheduledEvent().g()), false, 1, null), GuildScheduledEventDetailsViewModel.class, context, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new GuildScheduledEventDetailsViewModel$endEventClicked$$inlined$let$lambda$1(this, context, function0), 60, (Object) null);
}
}
public final void onDeleteButtonClicked(Context context, Function0<Unit> function0) {
m.checkNotNullParameter(context, "context");
m.checkNotNullParameter(function0, "onSuccess");
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Initialized)) {
viewState = null;
}
ViewState.Initialized initialized = (ViewState.Initialized) viewState;
if (initialized != null) {
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.restSubscribeOn$default(RestAPI.Companion.getApi().deleteGuildScheduledEvent(initialized.getGuildScheduledEvent().g()), false, 1, null), GuildScheduledEventDetailsViewModel.class, context, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new GuildScheduledEventDetailsViewModel$onDeleteButtonClicked$$inlined$let$lambda$1(this, context, function0), 60, (Object) null);
}
}
public final void onGuildNameClicked() {
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Initialized)) {
viewState = null;
}
ViewState.Initialized initialized = (ViewState.Initialized) viewState;
if (initialized != null) {
StoreStream.Companion.getGuildSelected().set(initialized.getGuild().getId());
}
}
public final void onRsvpButtonClicked() {
ViewState viewState = getViewState();
if (!(viewState instanceof ViewState.Initialized)) {
viewState = null;
}
ViewState.Initialized initialized = (ViewState.Initialized) viewState;
if (initialized != null) {
this.guildScheduledEventsStore.toggleRsvpGuildScheduledEvent(initialized.getGuildScheduledEvent());
}
}
}