package com.discord.widgets.channels; import com.discord.models.user.User; import com.discord.stores.StoreStream; import d0.g0.w; import d0.z.d.m; import j0.k.b; import java.util.List; import java.util.Map; import rx.Observable; /* compiled from: WidgetGroupInviteFriends.kt */ public final class WidgetGroupInviteFriends$Model$Companion$getFilteredFriends$2 implements b, Observable>> { public final /* synthetic */ String $nameFilter; /* compiled from: WidgetGroupInviteFriends.kt */ /* renamed from: com.discord.widgets.channels.WidgetGroupInviteFriends$Model$Companion$getFilteredFriends$2$1 reason: invalid class name */ public static final class AnonymousClass1 implements b, Observable>> { public final /* synthetic */ List $excludeUserIds; public final /* synthetic */ WidgetGroupInviteFriends$Model$Companion$getFilteredFriends$2 this$0; /* compiled from: WidgetGroupInviteFriends.kt */ /* renamed from: com.discord.widgets.channels.WidgetGroupInviteFriends$Model$Companion$getFilteredFriends$2$1$1 reason: invalid class name */ public static final class AnonymousClass1 implements b, Observable>> { public final /* synthetic */ Map $relationships; public final /* synthetic */ AnonymousClass1 this$0; /* compiled from: WidgetGroupInviteFriends.kt */ /* renamed from: com.discord.widgets.channels.WidgetGroupInviteFriends$Model$Companion$getFilteredFriends$2$1$1$1 reason: invalid class name */ public static final class AnonymousClass1 implements b, Boolean> { public final /* synthetic */ Map $users; public final /* synthetic */ AnonymousClass1 this$0; public AnonymousClass1(AnonymousClass1 r1, Map map) { this.this$0 = r1; this.$users = map; } /* JADX WARNING: Code restructure failed: missing block: B:13:0x0047, code lost: if (r0 != null) goto L_0x004c; */ /* JADX WARNING: Code restructure failed: missing block: B:17:0x0052, code lost: if (r5 != false) goto L_0x0056; */ public final Boolean call(Map.Entry entry) { boolean z2; User user; String username; String str; boolean z3 = true; if (!this.this$0.this$0.$excludeUserIds.contains(entry.getKey()) && this.$users.containsKey(entry.getKey())) { Map map = this.$users; if (map == null || (user = (User) map.get(entry.getKey())) == null || (username = user.getUsername()) == null) { z2 = false; } else { String str2 = this.this$0.this$0.this$0.$nameFilter; if (str2 != null) { str = str2.toLowerCase(); m.checkNotNullExpressionValue(str, "(this as java.lang.String).toLowerCase()"); } str = ""; z2 = w.contains((CharSequence) username, (CharSequence) str, true); } } z3 = false; return Boolean.valueOf(z3); } /* 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 // j0.k.b public /* bridge */ /* synthetic */ Boolean call(Map.Entry entry) { return call((Map.Entry) entry); } } /* compiled from: WidgetGroupInviteFriends.kt */ /* renamed from: com.discord.widgets.channels.WidgetGroupInviteFriends$Model$Companion$getFilteredFriends$2$1$1$2 reason: invalid class name */ public static final class AnonymousClass2 implements b, Long> { public static final AnonymousClass2 INSTANCE = new AnonymousClass2(); public final Long call(Map.Entry entry) { return entry.getKey(); } /* 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 // j0.k.b public /* bridge */ /* synthetic */ Long call(Map.Entry entry) { return call((Map.Entry) entry); } } /* compiled from: WidgetGroupInviteFriends.kt */ /* renamed from: com.discord.widgets.channels.WidgetGroupInviteFriends$Model$Companion$getFilteredFriends$2$1$1$3 reason: invalid class name */ public static final class AnonymousClass3 implements b, Integer> { public static final AnonymousClass3 INSTANCE = new AnonymousClass3(); public final Integer call(Map.Entry entry) { return entry.getValue(); } /* 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 // j0.k.b public /* bridge */ /* synthetic */ Integer call(Map.Entry entry) { return call((Map.Entry) entry); } } public AnonymousClass1(AnonymousClass1 r1, Map map) { this.this$0 = r1; this.$relationships = map; } public final Observable> call(Map map) { return Observable.A(this.$relationships.entrySet()).x(new AnonymousClass1(this, map)).g0(AnonymousClass2.INSTANCE, AnonymousClass3.INSTANCE); } } public AnonymousClass1(WidgetGroupInviteFriends$Model$Companion$getFilteredFriends$2 widgetGroupInviteFriends$Model$Companion$getFilteredFriends$2, List list) { this.this$0 = widgetGroupInviteFriends$Model$Companion$getFilteredFriends$2; this.$excludeUserIds = list; } /* 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 // j0.k.b public /* bridge */ /* synthetic */ Observable> call(Map map) { return call((Map) map); } public final Observable> call(Map map) { return StoreStream.Companion.getUsers().observeUsers(map.keySet()).Y(new AnonymousClass1(this, map)); } } public WidgetGroupInviteFriends$Model$Companion$getFilteredFriends$2(String str) { this.$nameFilter = str; } public final Observable> call(List list) { return StoreStream.Companion.getUserRelationships().observeForType(1).Y(new AnonymousClass1(this, list)); } }