package zn; import android.os.Bundle; import androidx.lifecycle.Lifecycle; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import com.meizu.cloud.pushsdk.notification.model.AdvanceSetting; import com.uber.autodispose.a0; import com.uber.autodispose.y; import com.xingin.account.entities.UserInfo; import com.xingin.alpha.api.service.AlphaConfigService; import com.xingin.alpha.bean.ApiResult; import com.xingin.alpha.bean.BeforeLiveInfoBean; import com.xingin.alpha.bean.EmceeInfo; import com.xingin.alpha.bean.EmceeUserInfo; import com.xingin.alpha.bean.FollowBean; import com.xingin.alpha.bean.RecommendEmcee; import com.xingin.alpha.end.adapter.LiveRecommendEmceeAdapter; import com.xingin.alpha.end.beforelive.AlphaEmceeNotInLivingActivity; import fy.r; import java.util.ArrayList; import java.util.List; import kotlin.Metadata; import kotlin.Unit; import kotlin.jvm.functions.Function0; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.FunctionReferenceImpl; import kotlin.jvm.internal.Intrinsics; import kotlin.jvm.internal.Lambda; import ln.d2; import okhttp3.ResponseBody; import sy.i0; import sy.v0; @Metadata(bv = {}, d1 = {"\u0000H\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\t\u0018\u00002\u0014\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0000\u0012\u0004\u0012\u00020\u00030\u0001B\u0007¢\u0006\u0004\b$\u0010%J\b\u0010\u0005\u001a\u00020\u0004H\u0002J\b\u0010\u0006\u001a\u00020\u0004H\u0002J\b\u0010\u0007\u001a\u00020\u0004H\u0002J\b\u0010\b\u001a\u00020\u0004H\u0002J\u0010\u0010\u000b\u001a\u00020\u00042\u0006\u0010\n\u001a\u00020\tH\u0002J\u0010\u0010\u000e\u001a\u00020\u00042\u0006\u0010\r\u001a\u00020\fH\u0002J\u0010\u0010\u000f\u001a\u00020\u00042\u0006\u0010\r\u001a\u00020\fH\u0002J\b\u0010\u0010\u001a\u00020\u0004H\u0002J\b\u0010\u0011\u001a\u00020\u0004H\u0002J\u0010\u0010\u0014\u001a\u00020\u00042\u0006\u0010\u0013\u001a\u00020\u0012H\u0002J\u0010\u0010\u0017\u001a\u00020\u00042\u0006\u0010\u0016\u001a\u00020\u0015H\u0002J\u0010\u0010\u0018\u001a\u00020\u00042\u0006\u0010\u0016\u001a\u00020\u0015H\u0002J\u0010\u0010\u0019\u001a\u00020\u00042\u0006\u0010\u0013\u001a\u00020\u0012H\u0002J\u0012\u0010\u001c\u001a\u00020\u00042\b\u0010\u001b\u001a\u0004\u0018\u00010\u001aH\u0014R\"\u0010\u001e\u001a\u00020\u001d8\u0006@\u0006X.¢\u0006\u0012\n\u0004\b\u001e\u0010\u001f\u001a\u0004\b \u0010!\"\u0004\b\"\u0010#¨\u0006&"}, d2 = {"Lzn/n;", "Ltu0/b;", "Lzn/s;", "Lzn/p;", "", com.alipay.sdk.widget.c.f18364b, "i1", "D1", "r1", "Lcom/xingin/alpha/bean/BeforeLiveInfoBean;", "bean", "w1", "", "aimUserId", "k1", "E1", "o1", "j1", "Lcom/xingin/alpha/bean/FollowBean;", "followBean", "A1", "", AdvanceSetting.NETWORK_TYPE, "z1", "B1", "C1", "Landroid/os/Bundle;", "savedInstanceState", "onAttach", "Lcom/xingin/alpha/end/beforelive/AlphaEmceeNotInLivingActivity;", "activity", "Lcom/xingin/alpha/end/beforelive/AlphaEmceeNotInLivingActivity;", "n1", "()Lcom/xingin/alpha/end/beforelive/AlphaEmceeNotInLivingActivity;", "setActivity", "(Lcom/xingin/alpha/end/beforelive/AlphaEmceeNotInLivingActivity;)V", "<init>", "()V", "alpha_library_release"}, k = 1, mv = {1, 6, 0}) /* compiled from: AlphaEmceeNotInLivingController.kt */ public final class n extends tu0.b<s, n, p> { /* renamed from: a reason: collision with root package name */ public AlphaEmceeNotInLivingActivity f163042a; /* renamed from: b reason: collision with root package name */ public BeforeLiveInfoBean f163043b; /* renamed from: c reason: collision with root package name */ public String f163044c; /* renamed from: d reason: collision with root package name */ public String f163045d = ""; /* renamed from: e reason: collision with root package name */ public List<RecommendEmcee> f163046e; /* renamed from: f reason: collision with root package name */ public LiveRecommendEmceeAdapter f163047f; @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48) /* compiled from: AlphaEmceeNotInLivingController.kt */ public static final class a extends Lambda implements Function0<Unit> { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ n f163048a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public a(n nVar) { super(0); this.f163048a = nVar; } @Override // kotlin.jvm.functions.Function0 public final void invoke() { String str; EmceeUserInfo userInfo; BeforeLiveInfoBean beforeLiveInfoBean = this.f163048a.f163043b; if (beforeLiveInfoBean == null || (userInfo = beforeLiveInfoBean.getUserInfo()) == null || (str = userInfo.getUserId()) == null) { str = ""; } this.f163048a.E1(str); fy.b.f78513a.e(str); } } @Metadata(bv = {}, d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00020\u0001¨\u0006\u0004"}, d2 = {"zn/n$b", "Lcom/google/gson/reflect/TypeToken;", "Lcom/xingin/alpha/bean/ApiResult;", "Lcom/xingin/alpha/bean/FollowBean;", "alpha_library_release"}, k = 1, mv = {1, 6, 0}) /* compiled from: AlphaEmceeNotInLivingController.kt */ public static final class b extends TypeToken<ApiResult<FollowBean>> { } @Metadata(k = 3, mv = {1, 6, 0}, xi = 48) /* compiled from: AlphaEmceeNotInLivingController.kt */ public /* synthetic */ class c extends FunctionReferenceImpl implements Function0<Unit> { public c(Object obj) { super(0, obj, n.class, "finishPage", "finishPage()V", 0); } @Override // kotlin.jvm.functions.Function0 public final void invoke() { ((n) this.receiver).j1(); } } @Metadata(k = 3, mv = {1, 6, 0}, xi = 48) /* compiled from: AlphaEmceeNotInLivingController.kt */ public /* synthetic */ class d extends FunctionReferenceImpl implements Function0<Unit> { public d(Object obj) { super(0, obj, n.class, "attentionOrNot", "attentionOrNot()V", 0); } @Override // kotlin.jvm.functions.Function0 public final void invoke() { ((n) this.receiver).i1(); } } @Metadata(k = 3, mv = {1, 6, 0}, xi = 48) /* compiled from: AlphaEmceeNotInLivingController.kt */ public /* synthetic */ class e extends FunctionReferenceImpl implements Function0<Unit> { public e(Object obj) { super(0, obj, n.class, "onclickAvatar", "onclickAvatar()V", 0); } @Override // kotlin.jvm.functions.Function0 public final void invoke() { ((n) this.receiver).D1(); } } @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0004\b\u0005\u0010\u0006"}, d2 = {"<anonymous>", "", "position", "", "kotlin.jvm.PlatformType", "invoke", "(Ljava/lang/Integer;)V"}, k = 3, mv = {1, 6, 0}, xi = 48) /* compiled from: AlphaEmceeNotInLivingController.kt */ public static final class f extends Lambda implements Function1<Integer, Unit> { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ n f163049a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public f(n nVar) { super(1); this.f163049a = nVar; } /* 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(Integer num) { invoke(num); return Unit.INSTANCE; } public final void invoke(Integer num) { String str; String str2; String str3; EmceeUserInfo userInfo; List list = this.f163049a.f163046e; Intrinsics.checkNotNullExpressionValue(num, "position"); Object obj = list.get(num.intValue()); n nVar = this.f163049a; RecommendEmcee recommendEmcee = (RecommendEmcee) obj; r rVar = r.f79942a; BeforeLiveInfoBean beforeLiveInfoBean = nVar.f163043b; if (beforeLiveInfoBean == null || (userInfo = beforeLiveInfoBean.getUserInfo()) == null || (str = userInfo.getUserId()) == null) { str = ""; } String valueOf = String.valueOf(recommendEmcee.getRoomId()); EmceeInfo emceeInfo = recommendEmcee.getEmceeInfo(); if (emceeInfo == null || (str2 = emceeInfo.getUserId()) == null) { str2 = ""; } String fstatus = recommendEmcee.getFstatus(); if (fstatus == null) { fstatus = ""; } String iconType = recommendEmcee.getIconType(); if (iconType == null) { str3 = ""; } else { str3 = iconType; } rVar.g(str, valueOf, str2, fstatus, str3); } } @Metadata(bv = {}, d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0003\u0010\u0004"}, d2 = {"Lcom/xingin/alpha/bean/RecommendEmcee;", AdvanceSetting.NETWORK_TYPE, "", "a", "(Lcom/xingin/alpha/bean/RecommendEmcee;)V"}, k = 3, mv = {1, 6, 0}) /* compiled from: AlphaEmceeNotInLivingController.kt */ public static final class g extends Lambda implements Function1<RecommendEmcee, Unit> { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ n f163050a; /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public g(n nVar) { super(1); this.f163050a = nVar; } public final void a(RecommendEmcee recommendEmcee) { String str; String str2; EmceeUserInfo userInfo; Intrinsics.checkNotNullParameter(recommendEmcee, AdvanceSetting.NETWORK_TYPE); r rVar = r.f79942a; BeforeLiveInfoBean beforeLiveInfoBean = this.f163050a.f163043b; if (beforeLiveInfoBean == null || (userInfo = beforeLiveInfoBean.getUserInfo()) == null || (str = userInfo.getUserId()) == null) { str = ""; } String valueOf = String.valueOf(recommendEmcee.getRoomId()); EmceeInfo emceeInfo = recommendEmcee.getEmceeInfo(); if (emceeInfo == null || (str2 = emceeInfo.getUserId()) == null) { str2 = ""; } String fstatus = recommendEmcee.getFstatus(); if (fstatus == null) { fstatus = ""; } String iconType = recommendEmcee.getIconType(); if (iconType == null) { iconType = ""; } rVar.e(str, valueOf, str2, fstatus, iconType); this.f163050a.j1(); i0.f131674a.T(this.f163050a.n1(), String.valueOf(recommendEmcee.getRoomId()), "recommend_live_end"); } /* 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(RecommendEmcee recommendEmcee) { a(recommendEmcee); return Unit.INSTANCE; } } @Metadata(bv = {}, d1 = {"\u0000\u0013\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\u000e\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00030\u00020\u0001¨\u0006\u0004"}, d2 = {"zn/n$h", "Lcom/google/gson/reflect/TypeToken;", "Lcom/xingin/alpha/bean/ApiResult;", "Lcom/xingin/alpha/bean/FollowBean;", "alpha_library_release"}, k = 1, mv = {1, 6, 0}) /* compiled from: AlphaEmceeNotInLivingController.kt */ public static final class h extends TypeToken<ApiResult<FollowBean>> { } public n() { ArrayList arrayList = new ArrayList(); this.f163046e = arrayList; this.f163047f = new LiveRecommendEmceeAdapter(true, arrayList, new g(this)); } public static final void F1(n nVar, ResponseBody responseBody) { Intrinsics.checkNotNullParameter(nVar, "this$0"); try { ApiResult apiResult = (ApiResult) new Gson().fromJson(responseBody.charStream(), new h().getType()); if (apiResult.getSuccess()) { FollowBean followBean = (FollowBean) apiResult.getData(); if (followBean != null) { nVar.C1(followBean); return; } return; } StringBuilder sb3 = new StringBuilder(); String msg = apiResult.getMsg(); if (msg == null) { msg = ""; } sb3.append(msg); sb3.append(" ["); sb3.append(apiResult.getResult()); sb3.append(']'); nVar.B1(new IllegalStateException(sb3.toString())); } catch (Exception e14) { nVar.B1(e14); } } public static final void G1(n nVar, Throwable th3) { Intrinsics.checkNotNullParameter(nVar, "this$0"); Intrinsics.checkNotNullExpressionValue(th3, AdvanceSetting.NETWORK_TYPE); nVar.B1(th3); th3.printStackTrace(); } public static final void l1(n nVar, Throwable th3) { Intrinsics.checkNotNullParameter(nVar, "this$0"); Intrinsics.checkNotNullExpressionValue(th3, AdvanceSetting.NETWORK_TYPE); nVar.z1(th3); th3.printStackTrace(); } public static final void m1(n nVar, ResponseBody responseBody) { Intrinsics.checkNotNullParameter(nVar, "this$0"); try { ApiResult apiResult = (ApiResult) new Gson().fromJson(responseBody.charStream(), new b().getType()); if (apiResult.getSuccess()) { FollowBean followBean = (FollowBean) apiResult.getData(); if (followBean != null) { nVar.A1(followBean); return; } return; } StringBuilder sb3 = new StringBuilder(); String msg = apiResult.getMsg(); if (msg == null) { msg = ""; } sb3.append(msg); sb3.append(" ["); sb3.append(apiResult.getResult()); sb3.append(']'); nVar.z1(new IllegalStateException(sb3.toString())); } catch (Exception e14) { nVar.z1(e14); } } public static final void p1(n nVar, UserInfo userInfo) { Intrinsics.checkNotNullParameter(nVar, "this$0"); nVar.f163044c = userInfo != null ? userInfo.getFstatus() : null; ((s) nVar.getPresenter()).n(i0.f131674a.O(nVar.f163044c)); } public static final void q1(Throwable th3) { } public static final void t1(n nVar, BeforeLiveInfoBean beforeLiveInfoBean) { Intrinsics.checkNotNullParameter(nVar, "this$0"); if (beforeLiveInfoBean != null) { nVar.w1(beforeLiveInfoBean); } } public static final void u1(Throwable th3) { v0.f131783a.b("end_live", th3, "audience -- endLive -- fail"); } public static final void x1(n nVar, Lifecycle.Event event) { Intrinsics.checkNotNullParameter(nVar, "this$0"); if (event == Lifecycle.Event.ON_RESUME) { nVar.o1(); } } public static final void y1(Throwable th3) { } public final void A1(FollowBean followBean) { this.f163044c = followBean.getFstatus(); ((s) getPresenter()).n(true); } public final void B1(Throwable th3) { ((s) getPresenter()).h(th3); } public final void C1(FollowBean followBean) { this.f163044c = followBean.getFstatus(); ((s) getPresenter()).n(false); } public final void D1() { EmceeUserInfo userInfo; BeforeLiveInfoBean beforeLiveInfoBean = this.f163043b; if (beforeLiveInfoBean != null && (userInfo = beforeLiveInfoBean.getUserInfo()) != null) { r.f79942a.f(userInfo.getUserId()); n1().D7(userInfo.getUserId(), userInfo.getNickname()); } } public final void E1(String str) { dw2.r<ResponseBody> W0 = cl.a.f12786a.O().unFollow("0", str).x1(mi2.a.P()).W0(gw2.a.a()); Intrinsics.checkNotNullExpressionValue(W0, "AlphaApiManager\n …dSchedulers.mainThread())"); Object n14 = W0.n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n14, "this.`as`(AutoDispose.autoDisposable(provider))"); ((y) n14).a(new i(this), new h(this)); } public final void i1() { String str; String str2; EmceeUserInfo userInfo; EmceeUserInfo userInfo2; BeforeLiveInfoBean beforeLiveInfoBean = this.f163043b; String userId = (beforeLiveInfoBean == null || (userInfo2 = beforeLiveInfoBean.getUserInfo()) == null) ? null : userInfo2.getUserId(); if ((userId == null || userId.length() == 0) || (str = this.f163044c) == null) { return; } if (i0.f131674a.O(str)) { ((s) getPresenter()).j(new a(this)); return; } BeforeLiveInfoBean beforeLiveInfoBean2 = this.f163043b; if (beforeLiveInfoBean2 == null || (userInfo = beforeLiveInfoBean2.getUserInfo()) == null || (str2 = userInfo.getUserId()) == null) { str2 = ""; } k1(str2); } public final void j1() { n1().finish(); d2.f102239a.z(); } public final void k1(String str) { dw2.r<ResponseBody> W0 = cl.a.f12786a.O().follow("0", str).x1(mi2.a.P()).W0(gw2.a.a()); Intrinsics.checkNotNullExpressionValue(W0, "AlphaApiManager\n …dSchedulers.mainThread())"); Object n14 = W0.n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n14, "this.`as`(AutoDispose.autoDisposable(provider))"); ((y) n14).a(new j(this), new g(this)); } public final AlphaEmceeNotInLivingActivity n1() { AlphaEmceeNotInLivingActivity alphaEmceeNotInLivingActivity = this.f163042a; if (alphaEmceeNotInLivingActivity != null) { return alphaEmceeNotInLivingActivity; } Intrinsics.throwUninitializedPropertyAccessException("activity"); return null; } public final void o1() { dw2.r<UserInfo> W0 = cl.a.f12786a.N().getUserInfo(this.f163045d).x1(mi2.a.P()).W0(gw2.a.a()); Intrinsics.checkNotNullExpressionValue(W0, "AlphaApiManager.userEdit…dSchedulers.mainThread())"); a0 a0Var = a0.D; Intrinsics.checkNotNullExpressionValue(a0Var, "UNBOUND"); Object n14 = W0.n(com.uber.autodispose.d.b(a0Var)); Intrinsics.checkExpressionValueIsNotNull(n14, "this.`as`(AutoDispose.autoDisposable(provider))"); ((y) n14).a(new e(this), l.f163040a); } @Override // tu0.b public void onAttach(Bundle bundle) { super.onAttach(bundle); v1(); String stringExtra = n1().getIntent().getStringExtra("emceeUserId"); if (stringExtra == null) { stringExtra = ""; } this.f163045d = stringExtra; Object n14 = n1().lifecycle().n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n14, "this.`as`(AutoDispose.autoDisposable(provider))"); ((y) n14).a(new d(this), k.f163039a); r1(); } public final void r1() { dw2.r W0 = AlphaConfigService.a.c(cl.a.f12786a.i(), 0, this.f163045d, 1, null).x1(mi2.a.P()).W0(gw2.a.a()); Intrinsics.checkNotNullExpressionValue(W0, "AlphaApiManager\n …dSchedulers.mainThread())"); Object n14 = W0.n(com.uber.autodispose.d.b(this)); Intrinsics.checkExpressionValueIsNotNull(n14, "this.`as`(AutoDispose.autoDisposable(provider))"); ((y) n14).a(new f(this), m.f163041a); } public final void v1() { bj2.h.e(((s) getPresenter()).g(), this, new c(this)); bj2.h.e(((s) getPresenter()).e(), this, new d(this)); bj2.h.e(((s) getPresenter()).f(), this, new e(this)); bj2.h.d(((s) getPresenter()).i(), this, new f(this)); } public final void w1(BeforeLiveInfoBean beforeLiveInfoBean) { this.f163043b = beforeLiveInfoBean; ((s) getPresenter()).m(beforeLiveInfoBean.getUserInfo()); this.f163044c = beforeLiveInfoBean.getUserInfo().getFstatus(); this.f163046e.clear(); if (beforeLiveInfoBean.getRecommend().getHasRecommend() && beforeLiveInfoBean.getRecommend().getRecommendList() != null) { this.f163046e.addAll(beforeLiveInfoBean.getRecommend().getRecommendList()); } ((s) getPresenter()).o(this.f163046e, this.f163047f); } public final void z1(Throwable th3) { ((s) getPresenter()).h(th3); } }