package c.a.a.e; import android.content.Context; import android.os.Bundle; import android.view.View; import android.widget.ImageView; import android.widget.RelativeLayout; import android.widget.TextView; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import c.a.j.x0; import com.discord.R; import com.discord.app.AppDialog; import com.discord.utilities.analytics.AnalyticsTracker; import com.discord.utilities.analytics.Traits; import com.discord.utilities.viewbinding.FragmentViewBindingDelegate; import com.discord.utilities.viewbinding.FragmentViewBindingDelegateKt; import com.discord.widgets.servers.premiumguild.WidgetPremiumGuildSubscription; import com.google.android.material.button.MaterialButton; import d0.z.d.k; import d0.z.d.m; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.DefaultConstructorMarker; import kotlin.reflect.KProperty; /* compiled from: PremiumGuildSubscriptionUpsellDialog.kt */ public final class a extends AppDialog { public static final /* synthetic */ KProperty[] i = {c.d.b.a.a.V(a.class, "binding", "getBinding()Lcom/discord/databinding/PremiumGuildSubscriptionUpsellDialogBinding;", 0)}; public static final b j = new b(null); public final FragmentViewBindingDelegate k = FragmentViewBindingDelegateKt.viewBinding$default(this, c.i, null, 2, null); /* compiled from: java-style lambda group */ /* renamed from: c.a.a.e.a$a reason: collision with other inner class name */ public static final class View$OnClickListenerC0012a implements View.OnClickListener { public final /* synthetic */ int i; public final /* synthetic */ Object j; public View$OnClickListenerC0012a(int i, Object obj) { this.i = i; this.j = obj; } @Override // android.view.View.OnClickListener public final void onClick(View view) { int i = this.i; if (i == 0) { ((a) this.j).dismiss(); } else if (i == 1) { ((a) this.j).dismiss(); } else { throw null; } } } /* compiled from: PremiumGuildSubscriptionUpsellDialog.kt */ public static final class b { public b(DefaultConstructorMarker defaultConstructorMarker) { } /* JADX WARNING: Removed duplicated region for block: B:17:0x0045 */ /* JADX WARNING: Removed duplicated region for block: B:19:0x0050 */ /* JADX WARNING: Removed duplicated region for block: B:26:0x007a */ /* JADX WARNING: Removed duplicated region for block: B:27:0x0080 */ /* JADX WARNING: Removed duplicated region for block: B:29:0x0083 */ /* JADX WARNING: Removed duplicated region for block: B:30:0x0089 */ /* JADX WARNING: Removed duplicated region for block: B:32:0x008c */ public final void a(FragmentManager fragmentManager, long j, Long l, Integer num, Traits.Location location) { String str; Bundle bundle; String page; String str2; m.checkNotNullParameter(fragmentManager, "fragmentManager"); a aVar = new a(); String str3 = null; if (num != null && num.intValue() == 1) { str2 = Traits.Location.ObjType.TIER_1; } else if (num != null && num.intValue() == 2) { str2 = Traits.Location.ObjType.TIER_2; } else if (num != null && num.intValue() == 3) { str2 = Traits.Location.ObjType.TIER_3; } else { str = null; bundle = new Bundle(); bundle.putLong("extra_guild_id", j); if (l != null) { bundle.putLong("extra_channel_id", l.longValue()); } if (str != null) { bundle.putString("extra_object_type", str); } if (!(location == null || (page = location.getPage()) == null)) { bundle.putString("extra_page", page); } aVar.setArguments(bundle); aVar.show(fragmentManager, a.class.getSimpleName()); AnalyticsTracker analyticsTracker = AnalyticsTracker.INSTANCE; String s2 = c.d.b.a.a.s("Premium Guild Upsell Modal - Tier ", str); String page2 = location == null ? location.getPage() : null; String str4 = location == null ? location.get_object() : null; if (location != null) { str3 = location.getSection(); } analyticsTracker.openModal(s2, new Traits.Location(page2, str3, str4, str, null, 16, null)); } str = str2; bundle = new Bundle(); bundle.putLong("extra_guild_id", j); if (l != null) { } if (str != null) { } bundle.putString("extra_page", page); aVar.setArguments(bundle); aVar.show(fragmentManager, a.class.getSimpleName()); AnalyticsTracker analyticsTracker = AnalyticsTracker.INSTANCE; String s2 = c.d.b.a.a.s("Premium Guild Upsell Modal - Tier ", str); if (location == null) { } if (location == null) { } if (location != null) { } analyticsTracker.openModal(s2, new Traits.Location(page2, str3, str4, str, null, 16, null)); } } /* compiled from: PremiumGuildSubscriptionUpsellDialog.kt */ public static final /* synthetic */ class c extends k implements Function1 { public static final c i = new c(); public c() { super(1, x0.class, "bind", "bind(Landroid/view/View;)Lcom/discord/databinding/PremiumGuildSubscriptionUpsellDialogBinding;", 0); } /* 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 x0 invoke(View view) { View view2 = view; m.checkNotNullParameter(view2, "p1"); int i2 = R.id.premium_guild_upsell_close; ImageView imageView = (ImageView) view2.findViewById(R.id.premium_guild_upsell_close); if (imageView != null) { i2 = R.id.premium_guild_upsell_close_button; TextView textView = (TextView) view2.findViewById(R.id.premium_guild_upsell_close_button); if (textView != null) { i2 = R.id.premium_guild_upsell_subscribe_button; MaterialButton materialButton = (MaterialButton) view2.findViewById(R.id.premium_guild_upsell_subscribe_button); if (materialButton != null) { return new x0((RelativeLayout) view2, imageView, textView, materialButton); } } } throw new NullPointerException("Missing required view with ID: ".concat(view2.getResources().getResourceName(i2))); } } /* compiled from: PremiumGuildSubscriptionUpsellDialog.kt */ public static final class d implements View.OnClickListener { public final /* synthetic */ a i; public final /* synthetic */ long j; public final /* synthetic */ Long k; public final /* synthetic */ String l; public final /* synthetic */ String m; public d(a aVar, long j, Long l, String str, String str2) { this.i = aVar; this.j = j; this.k = l; this.l = str; this.m = str2; } @Override // android.view.View.OnClickListener public final void onClick(View view) { AnalyticsTracker.INSTANCE.premiumGuildPromotionOpened(this.j, new Traits.Location(this.l, Traits.Location.Section.PREMIUM_GUILD_UPSELL_MODAL, Traits.Location.Obj.BUTTON_CTA, this.m, null, 16, null), this.k); WidgetPremiumGuildSubscription.Companion companion = WidgetPremiumGuildSubscription.Companion; Context requireContext = this.i.requireContext(); m.checkNotNullExpressionValue(requireContext, "requireContext()"); companion.create(requireContext, this.j); this.i.dismiss(); } } public a() { super(R.layout.premium_guild_subscription_upsell_dialog); } public final x0 g() { return (x0) this.k.getValue((Fragment) this, i[0]); } @Override // com.discord.app.AppDialog public void onViewBound(View view) { m.checkNotNullParameter(view, "view"); super.onViewBound(view); long j2 = getArgumentsOrDefault().getLong("extra_guild_id", -1); Bundle arguments = getArguments(); Long valueOf = arguments != null ? Long.valueOf(arguments.getLong("extra_channel_id")) : null; Bundle arguments2 = getArguments(); String string = arguments2 != null ? arguments2.getString("extra_object_type") : null; Bundle arguments3 = getArguments(); g().d.setOnClickListener(new d(this, j2, valueOf, arguments3 != null ? arguments3.getString("extra_page") : null, string)); g().b.setOnClickListener(new View$OnClickListenerC0012a(0, this)); g().f185c.setOnClickListener(new View$OnClickListenerC0012a(1, this)); } }