package dm2; import android.content.Intent; import android.content.pm.PackageManager; import android.net.Uri; import androidx.biometric.g0; import androidx.lifecycle.LiveData; import bd.v; import bd.w; import bi0.j; import com.linecorp.line.album.ui.viewmodel.n1; import com.linecorp.voip.core.CallConnectInfo; import em3.s; import hg2.d; import kotlin.NoWhenBranchMatchedException; import kotlin.Pair; import kotlin.TuplesKt; import org.json.JSONObject; import qi2.c; import si2.g; import vl2.h; import vl2.i; import wl2.n; import wl2.q; import yj2.e; public final class o extends i { /* renamed from: f reason: collision with root package name */ public final g<?> f64492f; /* renamed from: g reason: collision with root package name */ public final i f64493g; public static final class a extends s implements dm3.a<String> { /* renamed from: b reason: collision with root package name */ public final /* synthetic */ o f64494b; /* renamed from: dm2.o$a$a reason: collision with other inner class name */ public /* synthetic */ class C0691a { public static final /* synthetic */ int[] $EnumSwitchMapping$0; static { int[] iArr = new int[e.values().length]; iArr[e.VIDEO.ordinal()] = 1; iArr[e.LIVE.ordinal()] = 2; iArr[e.PLAYLIST.ordinal()] = 3; $EnumSwitchMapping$0 = iArr; } } /* JADX INFO: super call moved to the top of the method (can break code semantics) */ public a(o oVar) { super(0); this.f64494b = oVar; } /* Return type fixed from 'java.lang.Object' to match base method */ @Override // dm3.a public String invoke() { a k14 = o.k(this.f64494b); e g44 = k14 != null ? k14.g4() : null; int i14 = g44 == null ? -1 : C0691a.$EnumSwitchMapping$0[g44.ordinal()]; if (i14 == -1) { return null; } if (i14 == 1) { return "common"; } if (i14 == 2) { return "livestream"; } if (i14 == 3) { return "playlist"; } throw new NoWhenBranchMatchedException(); } } public final class b implements i.a { /* renamed from: a reason: collision with root package name */ public final ck2.a f64495a; /* renamed from: b reason: collision with root package name */ public final vl2.b f64496b; /* renamed from: c reason: collision with root package name */ public final n f64497c; public b(ck2.a aVar, vl2.b bVar) { Pair pair; this.f64495a = aVar; this.f64496b = bVar; if (aVar.getType() == e.PLAYLIST) { pair = TuplesKt.to(l.LOADING, e.PLAYLIST); } else { pair = TuplesKt.to(l.PLAYING, e.VIDEO); } this.f64497c = new n((l) pair.component1(), (e) pair.component2(), aVar.getId(), aVar.getTitle(), aVar.l().f18870c, false, 0); } @Override // vl2.i.a public void a() { } @Override // vl2.i.a public vl2.b b() { return this.f64496b; } @Override // vl2.i.a public void c() { a k14 = o.k(o.this); if (k14 != null) { k14.d4(this.f64495a.getType()); } } @Override // vl2.h public JSONObject toJSONObject() { return this.f64497c.toJSONObject(); } } public o(g<?> gVar) { super(gVar, q.YOUTUBE); int i14; i iVar; CallConnectInfo d14; this.f64492f = gVar; com.linecorp.voip.core.a d15 = g0.d(gVar); zl2.e eVar = null; d u14 = (d15 == null || (d14 = d15.d()) == null) ? null : d14.u(); if (u14 == null) { i14 = -1; } else { i14 = h.$EnumSwitchMapping$0[u14.ordinal()]; } if (i14 == 1) { iVar = v.f12339b; } else { iVar = w.f12341b; } this.f64493g = iVar; ul2.b c14 = c(); eVar = c14 != null ? c14.z() : eVar; if (eVar != null) { eVar.f149706b.put("wtvideotype", new tj2.d(new a(this))); } } public static void j(o oVar, com.linecorp.voip.ui.base.dialog.d dVar, int i14) { em3.q.f(oVar, "this$0"); em3.q.f(dVar, "<anonymous parameter 0>"); super.e(); } public static final a k(o oVar) { wl2.a d14 = oVar.d(); wl2.o F = d14 != null ? d14.F(q.YOUTUBE) : null; if (F instanceof a) { return (a) F; } return null; } @Override // vl2.i public boolean a(vl2.a aVar) { em3.q.f(aVar, "data"); return aVar instanceof ck2.a; } @Override // vl2.i public void e() { g.h(this.f64492f, com.linecorp.voip.ui.base.dialog.a.h(this.f64492f.d().getString(this.f64493g.e()), this.f64492f.d().getString(this.f64493g.h()), this.f64492f.d().getString(this.f64493g.g()), new j(this, 7), n1.f34317h), false, 2, null); } @Override // vl2.i public void f(vl2.a aVar, vl2.b bVar) { Pair pair; wl2.d value; em3.q.f(aVar, "model"); em3.q.f(bVar, "entryPoint"); if (aVar instanceof ck2.a) { wl2.a d14 = d(); if (d14 != null && (value = d14.getData().getValue()) != null && em3.q.b(value.f177420b, d14.D()) && value.f177419a == q.YOUTUBE) { pair = TuplesKt.to(Integer.valueOf(this.f64493g.l()), Integer.valueOf(this.f64493g.c())); } else { pair = TuplesKt.to(Integer.valueOf(this.f64493g.j()), Integer.valueOf(this.f64493g.k())); } int intValue = ((Number) pair.component1()).intValue(); int intValue2 = ((Number) pair.component2()).intValue(); b bVar2 = new b((ck2.a) aVar, bVar); if (vl2.b.CHAT_ROOM == bVar) { i(bVar2); } else { g.h(this.f64492f, com.linecorp.voip.ui.base.dialog.a.h(this.f64492f.d().getString(intValue), this.f64492f.d().getString(intValue2), this.f64492f.d().getString(this.f64493g.g()), new kx0.a(this, bVar2), gv.i.f78083f), false, 2, null); } } } @Override // vl2.i public void g() { String str; wl2.e eVar; LiveData<n> E; n value; wl2.e eVar2; ul2.b c14 = c(); if (!((c14 == null || (eVar2 = (wl2.e) c14.f()) == null) ? false : g0.r(eVar2))) { ul2.b c15 = c(); h hVar = (c15 == null || (eVar = (wl2.e) c15.f()) == null || (E = eVar.E()) == null || (value = E.getValue()) == null) ? null : value.f177461d; n nVar = hVar instanceof n ? (n) hVar : null; if (nVar != null) { c b14 = this.f64492f.b(); ri2.b f14 = g0.f(this.f64492f); String valueOf = String.valueOf(nVar.f64486c); Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(valueOf.length() != 0 ? "https://www.youtube.com/watch?v=".concat(valueOf) : new String("https://www.youtube.com/watch?v="))); PackageManager packageManager = f14.getPackageManager(); Uri uri = dg.w.f63621a; if (packageManager.hasSystemFeature("android.software.leanback")) { str = "com.google.android.youtube.tv"; } else { str = packageManager.hasSystemFeature("com.google.android.tv") ? "com.google.android.youtube.googletv" : "com.google.android.youtube"; } Intent intent2 = intent.setPackage(str); intent2.putExtra("app_package", f14.getPackageName()).putExtra("app_version", dg.w.b(f14)).putExtra("client_library_version", "1.2.2"); Intent putExtra = intent2.putExtra("force_fullscreen", false).putExtra("finish_on_ended", false); em3.q.e(putExtra, "createPlayVideoIntent(activity, it.videoId)"); c.f(b14, putExtra, null, 2, null); } } } @Override // vl2.i public void h() { ul2.b c14 = c(); zl2.e z14 = c14 != null ? c14.z() : null; if (z14 != null) { z14.f149706b.remove("wtvideotype"); } } }