2021-08-18 06:27:30 +00:00
|
|
|
package com.discord.widgets.guildscheduledevent;
|
|
|
|
|
2021-09-10 06:36:33 +00:00
|
|
|
import android.content.Context;
|
|
|
|
import androidx.annotation.MainThread;
|
2021-08-18 06:27:30 +00:00
|
|
|
import c.d.b.a.a;
|
2021-10-15 06:18:26 +00:00
|
|
|
import c0.z.d.m;
|
|
|
|
import c0.z.d.o;
|
2021-08-18 06:27:30 +00:00
|
|
|
import com.discord.api.channel.Channel;
|
2021-10-08 22:11:56 +00:00
|
|
|
import com.discord.api.channel.ChannelUtils;
|
2021-09-16 17:51:42 +00:00
|
|
|
import com.discord.api.guild.GuildFeature;
|
2021-09-21 06:31:55 +00:00
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEvent;
|
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEventEntityMetadata;
|
2021-08-18 06:27:30 +00:00
|
|
|
import com.discord.api.guildscheduledevent.GuildScheduledEventEntityType;
|
|
|
|
import com.discord.app.AppViewModel;
|
2021-09-16 17:51:42 +00:00
|
|
|
import com.discord.models.guild.Guild;
|
2021-08-18 06:27:30 +00:00
|
|
|
import com.discord.stores.StoreChannels;
|
2021-09-21 06:31:55 +00:00
|
|
|
import com.discord.stores.StoreGuildScheduledEvents;
|
2021-09-16 17:51:42 +00:00
|
|
|
import com.discord.stores.StoreGuilds;
|
2021-09-10 06:36:33 +00:00
|
|
|
import com.discord.stores.StorePermissions;
|
2021-08-18 06:27:30 +00:00
|
|
|
import com.discord.stores.StoreStream;
|
2021-09-10 06:36:33 +00:00
|
|
|
import com.discord.stores.updates.ObservationDeck;
|
|
|
|
import com.discord.stores.updates.ObservationDeckProvider;
|
2021-09-22 06:37:51 +00:00
|
|
|
import com.discord.utilities.guildscheduledevent.GuildScheduledEventTiming;
|
2021-09-10 06:36:33 +00:00
|
|
|
import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilities;
|
2021-09-22 06:37:51 +00:00
|
|
|
import com.discord.utilities.guildscheduledevent.GuildScheduledEventUtilitiesKt;
|
2021-09-10 06:36:33 +00:00
|
|
|
import com.discord.utilities.rx.ObservableExtensionsKt;
|
|
|
|
import java.util.HashSet;
|
2021-09-18 07:43:22 +00:00
|
|
|
import java.util.Iterator;
|
2021-09-10 06:36:33 +00:00
|
|
|
import java.util.LinkedHashMap;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Set;
|
|
|
|
import kotlin.Unit;
|
|
|
|
import kotlin.jvm.functions.Function0;
|
|
|
|
import kotlin.jvm.functions.Function1;
|
2021-08-18 06:27:30 +00:00
|
|
|
import kotlin.jvm.internal.DefaultConstructorMarker;
|
2021-09-10 06:36:33 +00:00
|
|
|
import rx.Observable;
|
2021-09-18 07:43:22 +00:00
|
|
|
/* compiled from: WidgetGuildScheduledEventLocationSelectViewModel.kt */
|
|
|
|
public final class WidgetGuildScheduledEventLocationSelectViewModel extends AppViewModel<ViewState> {
|
2021-08-18 06:27:30 +00:00
|
|
|
public static final Companion Companion = new Companion(null);
|
|
|
|
private final StoreChannels channelsStore;
|
2021-09-10 06:36:33 +00:00
|
|
|
private StoreState currentStoreState;
|
2021-09-21 06:31:55 +00:00
|
|
|
private final Long existingGuildScheduledEventId;
|
2021-09-10 06:36:33 +00:00
|
|
|
private final Long initialChannelId;
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
/* compiled from: WidgetGuildScheduledEventLocationSelectViewModel.kt */
|
|
|
|
/* renamed from: com.discord.widgets.guildscheduledevent.WidgetGuildScheduledEventLocationSelectViewModel$1 reason: invalid class name */
|
2021-09-10 06:36:33 +00:00
|
|
|
public static final class AnonymousClass1 extends o implements Function1<StoreState, Unit> {
|
2021-09-18 07:43:22 +00:00
|
|
|
public final /* synthetic */ WidgetGuildScheduledEventLocationSelectViewModel this$0;
|
2021-09-10 06:36:33 +00:00
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
2021-09-18 07:43:22 +00:00
|
|
|
public AnonymousClass1(WidgetGuildScheduledEventLocationSelectViewModel widgetGuildScheduledEventLocationSelectViewModel) {
|
2021-09-10 06:36:33 +00:00
|
|
|
super(1);
|
2021-09-18 07:43:22 +00:00
|
|
|
this.this$0 = widgetGuildScheduledEventLocationSelectViewModel;
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* 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) {
|
2021-09-18 07:43:22 +00:00
|
|
|
WidgetGuildScheduledEventLocationSelectViewModel widgetGuildScheduledEventLocationSelectViewModel = this.this$0;
|
2021-09-10 06:36:33 +00:00
|
|
|
m.checkNotNullExpressionValue(storeState, "it");
|
2021-09-18 07:43:22 +00:00
|
|
|
WidgetGuildScheduledEventLocationSelectViewModel.access$handleStoreState(widgetGuildScheduledEventLocationSelectViewModel, storeState);
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
}
|
2021-08-18 06:27:30 +00:00
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
/* compiled from: WidgetGuildScheduledEventLocationSelectViewModel.kt */
|
2021-08-18 06:27:30 +00:00
|
|
|
public static final class Companion {
|
|
|
|
private Companion() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
2021-09-10 06:36:33 +00:00
|
|
|
|
2021-09-21 06:31:55 +00:00
|
|
|
public static final /* synthetic */ Observable access$observeStores(Companion companion, long j, Long l, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, StoreGuildScheduledEvents storeGuildScheduledEvents) {
|
|
|
|
return companion.observeStores(j, l, storeGuilds, storeChannels, storePermissions, storeGuildScheduledEvents);
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
|
2021-09-21 06:31:55 +00:00
|
|
|
private final Observable<StoreState> observeStores(long j, Long l, StoreGuilds storeGuilds, StoreChannels storeChannels, StorePermissions storePermissions, StoreGuildScheduledEvents storeGuildScheduledEvents) {
|
|
|
|
return ObservationDeck.connectRx$default(ObservationDeckProvider.get(), new ObservationDeck.UpdateSource[]{storeChannels, storePermissions}, false, null, null, new WidgetGuildScheduledEventLocationSelectViewModel$Companion$observeStores$1(storeGuilds, j, storeChannels, storePermissions, l, storeGuildScheduledEvents), 14, null);
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
/* compiled from: WidgetGuildScheduledEventLocationSelectViewModel.kt */
|
2021-09-10 06:36:33 +00:00
|
|
|
public static final class StoreState {
|
|
|
|
private final Map<Long, Long> channelPermissions;
|
|
|
|
private final Map<Long, Channel> channels;
|
2021-09-21 06:31:55 +00:00
|
|
|
private final GuildScheduledEvent existingGuildScheduledEvent;
|
2021-09-16 17:51:42 +00:00
|
|
|
private final Guild guild;
|
2021-09-10 06:36:33 +00:00
|
|
|
private final Long guildPermissions;
|
|
|
|
|
2021-09-21 06:31:55 +00:00
|
|
|
public StoreState(Guild guild, Map<Long, Channel> map, Map<Long, Long> map2, Long l, GuildScheduledEvent guildScheduledEvent) {
|
2021-09-10 06:36:33 +00:00
|
|
|
m.checkNotNullParameter(map, "channels");
|
|
|
|
m.checkNotNullParameter(map2, "channelPermissions");
|
2021-09-16 17:51:42 +00:00
|
|
|
this.guild = guild;
|
2021-09-10 06:36:33 +00:00
|
|
|
this.channels = map;
|
|
|
|
this.channelPermissions = map2;
|
|
|
|
this.guildPermissions = l;
|
2021-09-21 06:31:55 +00:00
|
|
|
this.existingGuildScheduledEvent = guildScheduledEvent;
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
|
2021-09-21 06:31:55 +00:00
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r3v0, resolved type: com.discord.widgets.guildscheduledevent.WidgetGuildScheduledEventLocationSelectViewModel$StoreState */
|
2021-09-10 06:36:33 +00:00
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
2021-09-21 06:31:55 +00:00
|
|
|
public static /* synthetic */ StoreState copy$default(StoreState storeState, Guild guild, Map map, Map map2, Long l, GuildScheduledEvent guildScheduledEvent, int i, Object obj) {
|
2021-09-10 06:36:33 +00:00
|
|
|
if ((i & 1) != 0) {
|
2021-09-16 17:51:42 +00:00
|
|
|
guild = storeState.guild;
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
if ((i & 2) != 0) {
|
2021-09-16 17:51:42 +00:00
|
|
|
map = storeState.channels;
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
if ((i & 4) != 0) {
|
2021-09-16 17:51:42 +00:00
|
|
|
map2 = storeState.channelPermissions;
|
|
|
|
}
|
|
|
|
if ((i & 8) != 0) {
|
2021-09-10 06:36:33 +00:00
|
|
|
l = storeState.guildPermissions;
|
|
|
|
}
|
2021-09-21 06:31:55 +00:00
|
|
|
if ((i & 16) != 0) {
|
|
|
|
guildScheduledEvent = storeState.existingGuildScheduledEvent;
|
|
|
|
}
|
|
|
|
return storeState.copy(guild, map, map2, l, guildScheduledEvent);
|
2021-09-16 17:51:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final Guild component1() {
|
|
|
|
return this.guild;
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
|
2021-09-16 17:51:42 +00:00
|
|
|
public final Map<Long, Channel> component2() {
|
2021-09-10 06:36:33 +00:00
|
|
|
return this.channels;
|
|
|
|
}
|
|
|
|
|
2021-09-16 17:51:42 +00:00
|
|
|
public final Map<Long, Long> component3() {
|
2021-09-10 06:36:33 +00:00
|
|
|
return this.channelPermissions;
|
|
|
|
}
|
|
|
|
|
2021-09-16 17:51:42 +00:00
|
|
|
public final Long component4() {
|
2021-09-10 06:36:33 +00:00
|
|
|
return this.guildPermissions;
|
|
|
|
}
|
|
|
|
|
2021-09-21 06:31:55 +00:00
|
|
|
public final GuildScheduledEvent component5() {
|
|
|
|
return this.existingGuildScheduledEvent;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final StoreState copy(Guild guild, Map<Long, Channel> map, Map<Long, Long> map2, Long l, GuildScheduledEvent guildScheduledEvent) {
|
2021-09-10 06:36:33 +00:00
|
|
|
m.checkNotNullParameter(map, "channels");
|
|
|
|
m.checkNotNullParameter(map2, "channelPermissions");
|
2021-09-21 06:31:55 +00:00
|
|
|
return new StoreState(guild, map, map2, l, guildScheduledEvent);
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof StoreState)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
StoreState storeState = (StoreState) obj;
|
2021-09-21 06:31:55 +00:00
|
|
|
return m.areEqual(this.guild, storeState.guild) && m.areEqual(this.channels, storeState.channels) && m.areEqual(this.channelPermissions, storeState.channelPermissions) && m.areEqual(this.guildPermissions, storeState.guildPermissions) && m.areEqual(this.existingGuildScheduledEvent, storeState.existingGuildScheduledEvent);
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final Map<Long, Long> getChannelPermissions() {
|
|
|
|
return this.channelPermissions;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Map<Long, Channel> getChannels() {
|
|
|
|
return this.channels;
|
|
|
|
}
|
|
|
|
|
2021-09-21 06:31:55 +00:00
|
|
|
public final GuildScheduledEvent getExistingGuildScheduledEvent() {
|
|
|
|
return this.existingGuildScheduledEvent;
|
|
|
|
}
|
|
|
|
|
2021-09-16 17:51:42 +00:00
|
|
|
public final Guild getGuild() {
|
|
|
|
return this.guild;
|
|
|
|
}
|
|
|
|
|
2021-09-10 06:36:33 +00:00
|
|
|
public final Long getGuildPermissions() {
|
|
|
|
return this.guildPermissions;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
2021-09-16 17:51:42 +00:00
|
|
|
Guild guild = this.guild;
|
2021-09-10 06:36:33 +00:00
|
|
|
int i = 0;
|
2021-09-16 17:51:42 +00:00
|
|
|
int hashCode = (guild != null ? guild.hashCode() : 0) * 31;
|
|
|
|
Map<Long, Channel> map = this.channels;
|
|
|
|
int hashCode2 = (hashCode + (map != null ? map.hashCode() : 0)) * 31;
|
2021-09-10 06:36:33 +00:00
|
|
|
Map<Long, Long> map2 = this.channelPermissions;
|
2021-09-16 17:51:42 +00:00
|
|
|
int hashCode3 = (hashCode2 + (map2 != null ? map2.hashCode() : 0)) * 31;
|
2021-09-10 06:36:33 +00:00
|
|
|
Long l = this.guildPermissions;
|
2021-09-21 06:31:55 +00:00
|
|
|
int hashCode4 = (hashCode3 + (l != null ? l.hashCode() : 0)) * 31;
|
|
|
|
GuildScheduledEvent guildScheduledEvent = this.existingGuildScheduledEvent;
|
|
|
|
if (guildScheduledEvent != null) {
|
|
|
|
i = guildScheduledEvent.hashCode();
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
2021-09-21 06:31:55 +00:00
|
|
|
return hashCode4 + i;
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2021-10-09 06:29:02 +00:00
|
|
|
StringBuilder O = a.O("StoreState(guild=");
|
|
|
|
O.append(this.guild);
|
|
|
|
O.append(", channels=");
|
|
|
|
O.append(this.channels);
|
|
|
|
O.append(", channelPermissions=");
|
|
|
|
O.append(this.channelPermissions);
|
|
|
|
O.append(", guildPermissions=");
|
|
|
|
O.append(this.guildPermissions);
|
|
|
|
O.append(", existingGuildScheduledEvent=");
|
|
|
|
O.append(this.existingGuildScheduledEvent);
|
|
|
|
O.append(")");
|
|
|
|
return O.toString();
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
/* compiled from: WidgetGuildScheduledEventLocationSelectViewModel.kt */
|
2021-08-18 06:27:30 +00:00
|
|
|
public static abstract class ViewState {
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
/* compiled from: WidgetGuildScheduledEventLocationSelectViewModel.kt */
|
2021-08-18 06:27:30 +00:00
|
|
|
public static final class Invalid extends ViewState {
|
|
|
|
public static final Invalid INSTANCE = new Invalid();
|
|
|
|
|
|
|
|
private Invalid() {
|
|
|
|
super(null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
/* compiled from: WidgetGuildScheduledEventLocationSelectViewModel.kt */
|
2021-08-18 06:27:30 +00:00
|
|
|
public static final class Valid extends ViewState {
|
2021-09-10 06:36:33 +00:00
|
|
|
private final Map<Long, Channel> availableChannels;
|
|
|
|
private final Set<Long> availableStageChannelIds;
|
|
|
|
private final Set<Long> availableVoiceChannelIds;
|
2021-09-22 06:37:51 +00:00
|
|
|
private final boolean canChangeChannel;
|
2021-09-10 06:36:33 +00:00
|
|
|
private final boolean canCreateExternalEvent;
|
2021-08-18 06:27:30 +00:00
|
|
|
private final String externalLocation;
|
|
|
|
private final Channel selectedChannel;
|
|
|
|
private final GuildScheduledEventEntityType selectedLocationOption;
|
2021-09-16 17:51:42 +00:00
|
|
|
private final boolean showStageOptionIfUnavailable;
|
2021-08-18 06:27:30 +00:00
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
2021-09-21 06:31:55 +00:00
|
|
|
public Valid(GuildScheduledEventEntityType guildScheduledEventEntityType, Channel channel, String str, Map<Long, Channel> map, Set<Long> set, Set<Long> set2, boolean z2, boolean z3, boolean z4) {
|
2021-08-18 06:27:30 +00:00
|
|
|
super(null);
|
|
|
|
m.checkNotNullParameter(guildScheduledEventEntityType, "selectedLocationOption");
|
|
|
|
m.checkNotNullParameter(str, "externalLocation");
|
2021-09-10 06:36:33 +00:00
|
|
|
m.checkNotNullParameter(map, "availableChannels");
|
|
|
|
m.checkNotNullParameter(set, "availableVoiceChannelIds");
|
|
|
|
m.checkNotNullParameter(set2, "availableStageChannelIds");
|
2021-08-18 06:27:30 +00:00
|
|
|
this.selectedLocationOption = guildScheduledEventEntityType;
|
|
|
|
this.selectedChannel = channel;
|
|
|
|
this.externalLocation = str;
|
2021-09-10 06:36:33 +00:00
|
|
|
this.availableChannels = map;
|
|
|
|
this.availableVoiceChannelIds = set;
|
|
|
|
this.availableStageChannelIds = set2;
|
|
|
|
this.canCreateExternalEvent = z2;
|
2021-09-16 17:51:42 +00:00
|
|
|
this.showStageOptionIfUnavailable = z3;
|
2021-09-22 06:37:51 +00:00
|
|
|
this.canChangeChannel = z4;
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
|
2021-09-21 06:31:55 +00:00
|
|
|
public static /* synthetic */ Valid copy$default(Valid valid, GuildScheduledEventEntityType guildScheduledEventEntityType, Channel channel, String str, Map map, Set set, Set set2, boolean z2, boolean z3, boolean z4, int i, Object obj) {
|
2021-09-22 06:37:51 +00:00
|
|
|
return valid.copy((i & 1) != 0 ? valid.selectedLocationOption : guildScheduledEventEntityType, (i & 2) != 0 ? valid.selectedChannel : channel, (i & 4) != 0 ? valid.externalLocation : str, (i & 8) != 0 ? valid.availableChannels : map, (i & 16) != 0 ? valid.availableVoiceChannelIds : set, (i & 32) != 0 ? valid.availableStageChannelIds : set2, (i & 64) != 0 ? valid.canCreateExternalEvent : z2, (i & 128) != 0 ? valid.showStageOptionIfUnavailable : z3, (i & 256) != 0 ? valid.canChangeChannel : z4);
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildScheduledEventEntityType component1() {
|
|
|
|
return this.selectedLocationOption;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Channel component2() {
|
|
|
|
return this.selectedChannel;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String component3() {
|
|
|
|
return this.externalLocation;
|
|
|
|
}
|
|
|
|
|
2021-09-10 06:36:33 +00:00
|
|
|
public final Map<Long, Channel> component4() {
|
|
|
|
return this.availableChannels;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Set<Long> component5() {
|
|
|
|
return this.availableVoiceChannelIds;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Set<Long> component6() {
|
|
|
|
return this.availableStageChannelIds;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean component7() {
|
|
|
|
return this.canCreateExternalEvent;
|
|
|
|
}
|
|
|
|
|
2021-09-16 17:51:42 +00:00
|
|
|
public final boolean component8() {
|
|
|
|
return this.showStageOptionIfUnavailable;
|
|
|
|
}
|
|
|
|
|
2021-09-21 06:31:55 +00:00
|
|
|
public final boolean component9() {
|
2021-09-22 06:37:51 +00:00
|
|
|
return this.canChangeChannel;
|
2021-09-21 06:31:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final Valid copy(GuildScheduledEventEntityType guildScheduledEventEntityType, Channel channel, String str, Map<Long, Channel> map, Set<Long> set, Set<Long> set2, boolean z2, boolean z3, boolean z4) {
|
2021-08-18 06:27:30 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEventEntityType, "selectedLocationOption");
|
|
|
|
m.checkNotNullParameter(str, "externalLocation");
|
2021-09-10 06:36:33 +00:00
|
|
|
m.checkNotNullParameter(map, "availableChannels");
|
|
|
|
m.checkNotNullParameter(set, "availableVoiceChannelIds");
|
|
|
|
m.checkNotNullParameter(set2, "availableStageChannelIds");
|
2021-09-21 06:31:55 +00:00
|
|
|
return new Valid(guildScheduledEventEntityType, channel, str, map, set, set2, z2, z3, z4);
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean equals(Object obj) {
|
|
|
|
if (this == obj) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (!(obj instanceof Valid)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
Valid valid = (Valid) obj;
|
2021-09-22 06:37:51 +00:00
|
|
|
return m.areEqual(this.selectedLocationOption, valid.selectedLocationOption) && m.areEqual(this.selectedChannel, valid.selectedChannel) && m.areEqual(this.externalLocation, valid.externalLocation) && m.areEqual(this.availableChannels, valid.availableChannels) && m.areEqual(this.availableVoiceChannelIds, valid.availableVoiceChannelIds) && m.areEqual(this.availableStageChannelIds, valid.availableStageChannelIds) && this.canCreateExternalEvent == valid.canCreateExternalEvent && this.showStageOptionIfUnavailable == valid.showStageOptionIfUnavailable && this.canChangeChannel == valid.canChangeChannel;
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final Map<Long, Channel> getAvailableChannels() {
|
|
|
|
return this.availableChannels;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Set<Long> getAvailableStageChannelIds() {
|
|
|
|
return this.availableStageChannelIds;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Set<Long> getAvailableVoiceChannelIds() {
|
|
|
|
return this.availableVoiceChannelIds;
|
|
|
|
}
|
|
|
|
|
2021-09-22 06:37:51 +00:00
|
|
|
public final boolean getCanChangeChannel() {
|
|
|
|
return this.canChangeChannel;
|
2021-09-21 06:31:55 +00:00
|
|
|
}
|
|
|
|
|
2021-09-10 06:36:33 +00:00
|
|
|
public final boolean getCanCreateExternalEvent() {
|
|
|
|
return this.canCreateExternalEvent;
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final String getExternalLocation() {
|
|
|
|
return this.externalLocation;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final Channel getSelectedChannel() {
|
|
|
|
return this.selectedChannel;
|
|
|
|
}
|
|
|
|
|
|
|
|
public final GuildScheduledEventEntityType getSelectedLocationOption() {
|
|
|
|
return this.selectedLocationOption;
|
|
|
|
}
|
|
|
|
|
2021-09-16 17:51:42 +00:00
|
|
|
public final boolean getShowStageOptionIfUnavailable() {
|
|
|
|
return this.showStageOptionIfUnavailable;
|
|
|
|
}
|
|
|
|
|
2021-08-18 06:27:30 +00:00
|
|
|
public int hashCode() {
|
|
|
|
GuildScheduledEventEntityType guildScheduledEventEntityType = this.selectedLocationOption;
|
|
|
|
int i = 0;
|
|
|
|
int hashCode = (guildScheduledEventEntityType != null ? guildScheduledEventEntityType.hashCode() : 0) * 31;
|
|
|
|
Channel channel = this.selectedChannel;
|
|
|
|
int hashCode2 = (hashCode + (channel != null ? channel.hashCode() : 0)) * 31;
|
|
|
|
String str = this.externalLocation;
|
2021-09-10 06:36:33 +00:00
|
|
|
int hashCode3 = (hashCode2 + (str != null ? str.hashCode() : 0)) * 31;
|
|
|
|
Map<Long, Channel> map = this.availableChannels;
|
|
|
|
int hashCode4 = (hashCode3 + (map != null ? map.hashCode() : 0)) * 31;
|
|
|
|
Set<Long> set = this.availableVoiceChannelIds;
|
|
|
|
int hashCode5 = (hashCode4 + (set != null ? set.hashCode() : 0)) * 31;
|
|
|
|
Set<Long> set2 = this.availableStageChannelIds;
|
|
|
|
if (set2 != null) {
|
|
|
|
i = set2.hashCode();
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
2021-09-10 06:36:33 +00:00
|
|
|
int i2 = (hashCode5 + i) * 31;
|
|
|
|
boolean z2 = this.canCreateExternalEvent;
|
2021-09-16 17:51:42 +00:00
|
|
|
int i3 = 1;
|
2021-09-10 06:36:33 +00:00
|
|
|
if (z2) {
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
int i4 = z2 ? 1 : 0;
|
|
|
|
int i5 = z2 ? 1 : 0;
|
2021-09-16 17:51:42 +00:00
|
|
|
int i6 = z2 ? 1 : 0;
|
|
|
|
int i7 = (i2 + i4) * 31;
|
|
|
|
boolean z3 = this.showStageOptionIfUnavailable;
|
2021-09-21 06:31:55 +00:00
|
|
|
if (z3) {
|
|
|
|
z3 = true;
|
2021-09-16 17:51:42 +00:00
|
|
|
}
|
2021-09-21 06:31:55 +00:00
|
|
|
int i8 = z3 ? 1 : 0;
|
|
|
|
int i9 = z3 ? 1 : 0;
|
|
|
|
int i10 = z3 ? 1 : 0;
|
|
|
|
int i11 = (i7 + i8) * 31;
|
2021-09-22 06:37:51 +00:00
|
|
|
boolean z4 = this.canChangeChannel;
|
2021-09-21 06:31:55 +00:00
|
|
|
if (!z4) {
|
|
|
|
i3 = z4 ? 1 : 0;
|
|
|
|
}
|
|
|
|
return i11 + i3;
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
2021-10-09 06:29:02 +00:00
|
|
|
StringBuilder O = a.O("Valid(selectedLocationOption=");
|
|
|
|
O.append(this.selectedLocationOption);
|
|
|
|
O.append(", selectedChannel=");
|
|
|
|
O.append(this.selectedChannel);
|
|
|
|
O.append(", externalLocation=");
|
|
|
|
O.append(this.externalLocation);
|
|
|
|
O.append(", availableChannels=");
|
|
|
|
O.append(this.availableChannels);
|
|
|
|
O.append(", availableVoiceChannelIds=");
|
|
|
|
O.append(this.availableVoiceChannelIds);
|
|
|
|
O.append(", availableStageChannelIds=");
|
|
|
|
O.append(this.availableStageChannelIds);
|
|
|
|
O.append(", canCreateExternalEvent=");
|
|
|
|
O.append(this.canCreateExternalEvent);
|
|
|
|
O.append(", showStageOptionIfUnavailable=");
|
|
|
|
O.append(this.showStageOptionIfUnavailable);
|
|
|
|
O.append(", canChangeChannel=");
|
|
|
|
return a.K(O, this.canChangeChannel, ")");
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private ViewState() {
|
|
|
|
}
|
|
|
|
|
|
|
|
public /* synthetic */ ViewState(DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
|
2021-09-21 06:31:55 +00:00
|
|
|
public WidgetGuildScheduledEventLocationSelectViewModel(long j, Long l, Long l2, StoreChannels storeChannels, StoreGuilds storeGuilds, StorePermissions storePermissions, StoreGuildScheduledEvents storeGuildScheduledEvents, Observable<StoreState> observable) {
|
2021-08-18 06:27:30 +00:00
|
|
|
super(null, 1, null);
|
|
|
|
m.checkNotNullParameter(storeChannels, "channelsStore");
|
2021-09-16 17:51:42 +00:00
|
|
|
m.checkNotNullParameter(storeGuilds, "guildsStore");
|
2021-09-10 06:36:33 +00:00
|
|
|
m.checkNotNullParameter(storePermissions, "permissionsStore");
|
2021-09-21 06:31:55 +00:00
|
|
|
m.checkNotNullParameter(storeGuildScheduledEvents, "guildScheduledEventsStore");
|
2021-09-10 06:36:33 +00:00
|
|
|
m.checkNotNullParameter(observable, "storeStateObservable");
|
|
|
|
this.initialChannelId = l;
|
2021-09-21 06:31:55 +00:00
|
|
|
this.existingGuildScheduledEventId = l2;
|
2021-08-18 06:27:30 +00:00
|
|
|
this.channelsStore = storeChannels;
|
2021-10-22 06:43:45 +00:00
|
|
|
Observable<StoreState> X = observable.X(i0.p.a.a());
|
|
|
|
m.checkNotNullExpressionValue(X, "storeStateObservable\n …Schedulers.computation())");
|
|
|
|
ObservableExtensionsKt.appSubscribe$default(ObservableExtensionsKt.ui$default(X, this, null, 2, null), WidgetGuildScheduledEventLocationSelectViewModel.class, (Context) null, (Function1) null, (Function1) null, (Function0) null, (Function0) null, new AnonymousClass1(this), 62, (Object) null);
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX WARNING: Illegal instructions before constructor call */
|
2021-09-21 06:31:55 +00:00
|
|
|
public /* synthetic */ WidgetGuildScheduledEventLocationSelectViewModel(long j, Long l, Long l2, StoreChannels storeChannels, StoreGuilds storeGuilds, StorePermissions storePermissions, StoreGuildScheduledEvents storeGuildScheduledEvents, Observable observable, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
|
|
|
this(j, l, l2, r1, r10, r11, r12, (i & 128) != 0 ? Companion.access$observeStores(Companion, j, l2, r10, r1, r11, r12) : observable);
|
|
|
|
StoreChannels channels = (i & 8) != 0 ? StoreStream.Companion.getChannels() : storeChannels;
|
|
|
|
StoreGuilds guilds = (i & 16) != 0 ? StoreStream.Companion.getGuilds() : storeGuilds;
|
|
|
|
StorePermissions permissions = (i & 32) != 0 ? StoreStream.Companion.getPermissions() : storePermissions;
|
|
|
|
StoreGuildScheduledEvents guildScheduledEvents = (i & 64) != 0 ? StoreStream.Companion.getGuildScheduledEvents() : storeGuildScheduledEvents;
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
public static final /* synthetic */ void access$handleStoreState(WidgetGuildScheduledEventLocationSelectViewModel widgetGuildScheduledEventLocationSelectViewModel, StoreState storeState) {
|
|
|
|
widgetGuildScheduledEventLocationSelectViewModel.handleStoreState(storeState);
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
|
|
|
|
2021-09-16 17:51:42 +00:00
|
|
|
private final GuildScheduledEventEntityType getEntityTypeForChannel(Channel channel) {
|
2021-10-20 06:51:20 +00:00
|
|
|
return channel == null ? GuildScheduledEventEntityType.NONE : ChannelUtils.E(channel) ? GuildScheduledEventEntityType.VOICE : ChannelUtils.z(channel) ? GuildScheduledEventEntityType.STAGE_INSTANCE : GuildScheduledEventEntityType.NONE;
|
2021-09-16 17:51:42 +00:00
|
|
|
}
|
|
|
|
|
2021-09-21 06:31:55 +00:00
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:34:0x00cd */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:35:0x00d2 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:41:0x00e9 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:46:0x00f6 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:55:0x010e */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:60:0x0120 */
|
2021-09-22 06:37:51 +00:00
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:61:0x0125 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:70:0x013e */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:79:0x0156 */
|
2021-09-10 06:36:33 +00:00
|
|
|
@MainThread
|
|
|
|
private final void handleStoreState(StoreState storeState) {
|
2021-09-21 06:31:55 +00:00
|
|
|
Long l;
|
|
|
|
GuildScheduledEventEntityType selectedLocationOption;
|
2021-09-22 06:37:51 +00:00
|
|
|
String externalLocation;
|
|
|
|
boolean z2;
|
2021-09-21 06:31:55 +00:00
|
|
|
GuildScheduledEvent existingGuildScheduledEvent;
|
|
|
|
GuildScheduledEventEntityMetadata d;
|
2021-09-16 17:51:42 +00:00
|
|
|
Set<GuildFeature> features;
|
2021-09-10 06:36:33 +00:00
|
|
|
this.currentStoreState = storeState;
|
|
|
|
ViewState viewState = getViewState();
|
2021-09-22 06:37:51 +00:00
|
|
|
GuildScheduledEventTiming guildScheduledEventTiming = null;
|
2021-09-10 06:36:33 +00:00
|
|
|
if (!(viewState instanceof ViewState.Valid)) {
|
|
|
|
viewState = null;
|
|
|
|
}
|
|
|
|
ViewState.Valid valid = (ViewState.Valid) viewState;
|
|
|
|
boolean canCreateExternalEvent = GuildScheduledEventUtilities.Companion.canCreateExternalEvent(storeState.getGuildPermissions());
|
|
|
|
Map<Long, Channel> channels = storeState.getChannels();
|
|
|
|
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
|
|
|
for (Map.Entry<Long, Channel> entry : channels.entrySet()) {
|
|
|
|
Channel value = entry.getValue();
|
|
|
|
if (GuildScheduledEventUtilities.Companion.canStartEventInChannel(value, (Long) a.c(value, storeState.getChannelPermissions()))) {
|
|
|
|
linkedHashMap.put(entry.getKey(), entry.getValue());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
HashSet hashSet = new HashSet();
|
|
|
|
HashSet hashSet2 = new HashSet();
|
|
|
|
for (Channel channel : linkedHashMap.values()) {
|
2021-10-20 06:51:20 +00:00
|
|
|
if (ChannelUtils.E(channel)) {
|
2021-09-10 06:36:33 +00:00
|
|
|
hashSet2.add(Long.valueOf(channel.h()));
|
2021-10-20 06:51:20 +00:00
|
|
|
} else if (ChannelUtils.z(channel)) {
|
2021-09-10 06:36:33 +00:00
|
|
|
hashSet.add(Long.valueOf(channel.h()));
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
2021-09-22 06:37:51 +00:00
|
|
|
boolean z3 = this.existingGuildScheduledEventId != null;
|
2021-09-21 06:31:55 +00:00
|
|
|
if (valid != null) {
|
2021-09-10 06:36:33 +00:00
|
|
|
Channel selectedChannel = valid.getSelectedChannel();
|
|
|
|
if (selectedChannel != null) {
|
|
|
|
l = Long.valueOf(selectedChannel.h());
|
2021-09-21 06:31:55 +00:00
|
|
|
Channel channel2 = (Channel) linkedHashMap.get(l);
|
|
|
|
selectedLocationOption = valid != null ? valid.getSelectedLocationOption() : storeState.getExistingGuildScheduledEvent() != null ? storeState.getExistingGuildScheduledEvent().e() : getEntityTypeForChannel(channel2);
|
|
|
|
if (selectedLocationOption != GuildScheduledEventEntityType.STAGE_INSTANCE && hashSet.isEmpty()) {
|
|
|
|
selectedLocationOption = GuildScheduledEventEntityType.NONE;
|
|
|
|
} else if (selectedLocationOption != GuildScheduledEventEntityType.VOICE && hashSet2.isEmpty()) {
|
|
|
|
selectedLocationOption = GuildScheduledEventEntityType.NONE;
|
|
|
|
} else if (selectedLocationOption == GuildScheduledEventEntityType.EXTERNAL && !canCreateExternalEvent) {
|
|
|
|
selectedLocationOption = GuildScheduledEventEntityType.NONE;
|
|
|
|
}
|
|
|
|
Guild guild = storeState.getGuild();
|
|
|
|
boolean contains = (guild != null || (features = guild.getFeatures()) == null) ? false : features.contains(GuildFeature.COMMUNITY);
|
2021-09-22 06:37:51 +00:00
|
|
|
externalLocation = valid != null ? valid.getExternalLocation() : (!z3 || l != null || (existingGuildScheduledEvent = storeState.getExistingGuildScheduledEvent()) == null || (d = existingGuildScheduledEvent.d()) == null) ? null : d.a();
|
|
|
|
if (z3) {
|
|
|
|
GuildScheduledEvent existingGuildScheduledEvent2 = storeState.getExistingGuildScheduledEvent();
|
|
|
|
if (existingGuildScheduledEvent2 != null) {
|
|
|
|
guildScheduledEventTiming = GuildScheduledEventUtilitiesKt.getEventTiming(existingGuildScheduledEvent2);
|
|
|
|
}
|
|
|
|
if (guildScheduledEventTiming == GuildScheduledEventTiming.LIVE) {
|
|
|
|
z2 = false;
|
|
|
|
if (externalLocation == null) {
|
|
|
|
externalLocation = "";
|
|
|
|
}
|
|
|
|
updateViewState(new ViewState.Valid(selectedLocationOption, channel2, externalLocation, linkedHashMap, hashSet2, hashSet, canCreateExternalEvent, contains, z2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
z2 = true;
|
|
|
|
if (externalLocation == null) {
|
2021-09-21 06:31:55 +00:00
|
|
|
}
|
2021-09-22 06:37:51 +00:00
|
|
|
updateViewState(new ViewState.Valid(selectedLocationOption, channel2, externalLocation, linkedHashMap, hashSet2, hashSet, canCreateExternalEvent, contains, z2));
|
2021-09-21 06:31:55 +00:00
|
|
|
}
|
|
|
|
} else {
|
2021-09-22 06:37:51 +00:00
|
|
|
if (z3) {
|
|
|
|
GuildScheduledEvent existingGuildScheduledEvent3 = storeState.getExistingGuildScheduledEvent();
|
|
|
|
if (existingGuildScheduledEvent3 != null) {
|
|
|
|
l = existingGuildScheduledEvent3.b();
|
2021-09-21 06:31:55 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
l = this.initialChannelId;
|
|
|
|
}
|
|
|
|
Channel channel2 = (Channel) linkedHashMap.get(l);
|
|
|
|
if (valid != null) {
|
|
|
|
}
|
|
|
|
if (selectedLocationOption != GuildScheduledEventEntityType.STAGE_INSTANCE) {
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
2021-09-21 06:31:55 +00:00
|
|
|
if (selectedLocationOption != GuildScheduledEventEntityType.VOICE) {
|
|
|
|
}
|
|
|
|
selectedLocationOption = GuildScheduledEventEntityType.NONE;
|
|
|
|
Guild guild = storeState.getGuild();
|
|
|
|
if (guild != null) {
|
|
|
|
}
|
|
|
|
if (valid != null) {
|
|
|
|
}
|
2021-09-22 06:37:51 +00:00
|
|
|
if (z3) {
|
|
|
|
}
|
|
|
|
z2 = true;
|
|
|
|
if (externalLocation == null) {
|
|
|
|
}
|
|
|
|
updateViewState(new ViewState.Valid(selectedLocationOption, channel2, externalLocation, linkedHashMap, hashSet2, hashSet, canCreateExternalEvent, contains, z2));
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
2021-09-21 06:31:55 +00:00
|
|
|
l = null;
|
2021-09-10 06:36:33 +00:00
|
|
|
Channel channel2 = (Channel) linkedHashMap.get(l);
|
2021-09-21 06:31:55 +00:00
|
|
|
if (valid != null) {
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
2021-09-21 06:31:55 +00:00
|
|
|
if (selectedLocationOption != GuildScheduledEventEntityType.STAGE_INSTANCE) {
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
2021-09-21 06:31:55 +00:00
|
|
|
if (selectedLocationOption != GuildScheduledEventEntityType.VOICE) {
|
|
|
|
}
|
|
|
|
selectedLocationOption = GuildScheduledEventEntityType.NONE;
|
2021-09-16 17:51:42 +00:00
|
|
|
Guild guild = storeState.getGuild();
|
2021-09-21 06:31:55 +00:00
|
|
|
if (guild != null) {
|
|
|
|
}
|
|
|
|
if (valid != null) {
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
2021-09-22 06:37:51 +00:00
|
|
|
if (z3) {
|
|
|
|
}
|
|
|
|
z2 = true;
|
|
|
|
if (externalLocation == null) {
|
|
|
|
}
|
|
|
|
updateViewState(new ViewState.Valid(selectedLocationOption, channel2, externalLocation, linkedHashMap, hashSet2, hashSet, canCreateExternalEvent, contains, z2));
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
|
2021-09-10 06:36:33 +00:00
|
|
|
public final StoreState getCurrentStoreState() {
|
|
|
|
return this.currentStoreState;
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final void selectChannel(long j) {
|
2021-09-10 06:36:33 +00:00
|
|
|
StoreState storeState;
|
|
|
|
Map<Long, Channel> channels;
|
2021-08-18 06:27:30 +00:00
|
|
|
Channel channel;
|
|
|
|
ViewState viewState = getViewState();
|
2021-09-10 06:36:33 +00:00
|
|
|
if ((viewState instanceof ViewState.Valid) && (storeState = this.currentStoreState) != null && (channels = storeState.getChannels()) != null && (channel = channels.get(Long.valueOf(j))) != null) {
|
2021-09-21 06:31:55 +00:00
|
|
|
updateViewState(ViewState.Valid.copy$default((ViewState.Valid) viewState, null, channel, null, null, null, null, false, false, false, 509, null));
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-18 07:43:22 +00:00
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r3v4, resolved type: java.lang.Object */
|
|
|
|
/* JADX DEBUG: Multi-variable search result rejected for r3v6, resolved type: java.lang.Object */
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:21:0x0048 */
|
|
|
|
/* JADX WARNING: Removed duplicated region for block: B:31:0x0070 */
|
2021-08-18 06:27:30 +00:00
|
|
|
public final void selectLocationOption(GuildScheduledEventEntityType guildScheduledEventEntityType) {
|
2021-09-18 07:43:22 +00:00
|
|
|
Channel channel;
|
|
|
|
GuildScheduledEventEntityType guildScheduledEventEntityType2;
|
|
|
|
Channel channel2;
|
|
|
|
boolean z2;
|
|
|
|
boolean z3;
|
|
|
|
Map<Long, Channel> channels;
|
2021-08-18 06:27:30 +00:00
|
|
|
m.checkNotNullParameter(guildScheduledEventEntityType, "locationOption");
|
|
|
|
ViewState viewState = getViewState();
|
2021-09-10 06:36:33 +00:00
|
|
|
if (viewState instanceof ViewState.Valid) {
|
|
|
|
ViewState.Valid valid = (ViewState.Valid) viewState;
|
|
|
|
if (guildScheduledEventEntityType != valid.getSelectedLocationOption()) {
|
2021-09-18 07:43:22 +00:00
|
|
|
Long l = this.initialChannelId;
|
|
|
|
Channel channel3 = null;
|
|
|
|
if (l != null) {
|
|
|
|
l.longValue();
|
|
|
|
StoreState storeState = this.currentStoreState;
|
|
|
|
if (!(storeState == null || (channels = storeState.getChannels()) == null)) {
|
|
|
|
channel = channels.get(this.initialChannelId);
|
|
|
|
guildScheduledEventEntityType2 = GuildScheduledEventEntityType.VOICE;
|
|
|
|
if (!(guildScheduledEventEntityType == guildScheduledEventEntityType2 && channel != null && channel.A() == 2)) {
|
|
|
|
if (guildScheduledEventEntityType != guildScheduledEventEntityType2) {
|
|
|
|
Iterator<T> it = valid.getAvailableChannels().values().iterator();
|
|
|
|
while (true) {
|
|
|
|
if (!it.hasNext()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
Object next = it.next();
|
|
|
|
if (((Channel) next).A() == 2) {
|
|
|
|
z3 = true;
|
|
|
|
continue;
|
|
|
|
} else {
|
|
|
|
z3 = false;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (z3) {
|
|
|
|
channel3 = next;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
channel3 = channel3;
|
|
|
|
} else {
|
|
|
|
GuildScheduledEventEntityType guildScheduledEventEntityType3 = GuildScheduledEventEntityType.STAGE_INSTANCE;
|
|
|
|
if (!(guildScheduledEventEntityType == guildScheduledEventEntityType3 && channel != null && channel.A() == 13)) {
|
|
|
|
if (guildScheduledEventEntityType == guildScheduledEventEntityType3) {
|
|
|
|
Iterator<T> it2 = valid.getAvailableChannels().values().iterator();
|
|
|
|
while (true) {
|
|
|
|
if (!it2.hasNext()) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
Object next2 = it2.next();
|
|
|
|
if (((Channel) next2).A() == 13) {
|
|
|
|
z2 = true;
|
|
|
|
continue;
|
|
|
|
} else {
|
|
|
|
z2 = false;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (z2) {
|
|
|
|
channel3 = next2;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
channel3 = channel3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
channel2 = channel3;
|
2021-09-21 06:31:55 +00:00
|
|
|
updateViewState(ViewState.Valid.copy$default(valid, guildScheduledEventEntityType, channel2, "", null, null, null, false, false, false, 504, null));
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
|
|
|
channel2 = channel;
|
2021-09-21 06:31:55 +00:00
|
|
|
updateViewState(ViewState.Valid.copy$default(valid, guildScheduledEventEntityType, channel2, "", null, null, null, false, false, false, 504, null));
|
2021-09-18 07:43:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
channel = null;
|
|
|
|
guildScheduledEventEntityType2 = GuildScheduledEventEntityType.VOICE;
|
|
|
|
if (guildScheduledEventEntityType != guildScheduledEventEntityType2) {
|
|
|
|
}
|
|
|
|
channel2 = channel3;
|
2021-09-21 06:31:55 +00:00
|
|
|
updateViewState(ViewState.Valid.copy$default(valid, guildScheduledEventEntityType, channel2, "", null, null, null, false, false, false, 504, null));
|
2021-09-10 06:36:33 +00:00
|
|
|
}
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-10 06:36:33 +00:00
|
|
|
public final void setCurrentStoreState(StoreState storeState) {
|
|
|
|
this.currentStoreState = storeState;
|
|
|
|
}
|
|
|
|
|
2021-08-18 06:27:30 +00:00
|
|
|
public final void setExternalLocation(String str) {
|
|
|
|
m.checkNotNullParameter(str, "newExternalLocation");
|
|
|
|
ViewState viewState = getViewState();
|
|
|
|
if (viewState instanceof ViewState.Valid) {
|
2021-09-21 06:31:55 +00:00
|
|
|
updateViewState(ViewState.Valid.copy$default((ViewState.Valid) viewState, null, null, str, null, null, null, false, false, false, 507, null));
|
2021-08-18 06:27:30 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|