package com.discord.widgets.status; import com.discord.api.channel.Channel; import com.discord.stores.StoreChannels; import com.discord.stores.StoreExperiments; import com.discord.stores.StorePermissions; import com.discord.stores.StoreThreadsActiveJoined; import com.discord.utilities.threads.ThreadUtils; import com.discord.widgets.forums.ForumUtils; import com.discord.widgets.status.WidgetThreadStatusViewModel; import d0.z.d.m; import j0.k.b; import java.util.Map; import rx.Observable; import rx.functions.Func4; /* compiled from: WidgetThreadStatusViewModel.kt */ /* loaded from: classes2.dex */ public final class WidgetThreadStatusViewModel$Companion$observeStoreState$1 implements b> { public final /* synthetic */ StoreChannels $storeChannels; public final /* synthetic */ StoreExperiments $storeExperiments; public final /* synthetic */ StorePermissions $storePermissions; public final /* synthetic */ StoreThreadsActiveJoined $storeThreadsActiveJoined; /* compiled from: WidgetThreadStatusViewModel.kt */ /* renamed from: com.discord.widgets.status.WidgetThreadStatusViewModel$Companion$observeStoreState$1$1 reason: invalid class name */ /* loaded from: classes2.dex */ public static final class AnonymousClass1 implements Func4>, Long, Channel, Boolean, WidgetThreadStatusViewModel.StoreState> { public final /* synthetic */ Channel $selectedChannel; public AnonymousClass1(Channel channel) { this.$selectedChannel = channel; } /* renamed from: call reason: avoid collision after fix types in other method */ public final WidgetThreadStatusViewModel.StoreState call2(Map> map, Long l, Channel channel, Boolean bool) { ThreadUtils threadUtils = ThreadUtils.INSTANCE; Channel channel2 = this.$selectedChannel; m.checkNotNullExpressionValue(channel2, "selectedChannel"); boolean canUnarchiveThread = threadUtils.canUnarchiveThread(channel2, l); boolean isThreadModerator = threadUtils.isThreadModerator(Long.valueOf(l != null ? l.longValue() : 0L)); m.checkNotNullExpressionValue(map, "activeJoinedThreads"); Channel channel3 = this.$selectedChannel; m.checkNotNullExpressionValue(bool, "canAccessRedesignedForumChannels"); return new WidgetThreadStatusViewModel.StoreState(map, channel3, channel, canUnarchiveThread, isThreadModerator, bool.booleanValue()); } @Override // rx.functions.Func4 public /* bridge */ /* synthetic */ WidgetThreadStatusViewModel.StoreState call(Map> map, Long l, Channel channel, Boolean bool) { return call2((Map>) map, l, channel, bool); } } public WidgetThreadStatusViewModel$Companion$observeStoreState$1(StoreThreadsActiveJoined storeThreadsActiveJoined, StorePermissions storePermissions, StoreChannels storeChannels, StoreExperiments storeExperiments) { this.$storeThreadsActiveJoined = storeThreadsActiveJoined; this.$storePermissions = storePermissions; this.$storeChannels = storeChannels; this.$storeExperiments = storeExperiments; } public final Observable call(Channel channel) { return Observable.h(this.$storeThreadsActiveJoined.observeActiveJoinedThreadsForGuild(channel.i()), this.$storePermissions.observePermissionsForChannel(channel.k()), this.$storeChannels.observeChannel(channel.u()), ForumUtils.observeCanAccessRedesignedForumChannels$default(ForumUtils.INSTANCE, channel.i(), this.$storeExperiments, null, 4, null), new AnonymousClass1(channel)).r(); } }