package com.google.android.gms.internal.ads;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.content.res.Resources;
import android.text.TextUtils;
import androidx.media3.exoplayer.rtsp.RtspHeaders;
import java.util.Map;

/* JADX INFO: loaded from: classes2.dex */
public final class sx extends zv1 {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final Map f16610d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final Activity f16611e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final String f16612f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final long f16613g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final long f16614h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final String f16615i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final String f16616j;

    public sx(x50 x50Var, Map map) {
        long j10;
        super(x50Var, "createCalendarEvent", 11);
        this.f16610d = map;
        this.f16611e = x50Var.zzj();
        this.f16612f = j("description");
        this.f16615i = j("summary");
        String str = (String) map.get("start_ticks");
        long j11 = -1;
        if (str == null) {
            j10 = -1;
        } else {
            try {
                j10 = Long.parseLong(str);
            } catch (NumberFormatException unused) {
                j10 = -1;
            }
        }
        this.f16613g = j10;
        String str2 = (String) this.f16610d.get("end_ticks");
        if (str2 != null) {
            try {
                j11 = Long.parseLong(str2);
            } catch (NumberFormatException unused2) {
            }
        }
        this.f16614h = j11;
        this.f16616j = j("location");
    }

    public final String j(String str) {
        Map map = this.f16610d;
        return TextUtils.isEmpty((CharSequence) map.get(str)) ? "" : (String) map.get(str);
    }

    @Override // com.google.android.gms.internal.ads.zv1, com.google.android.gms.internal.ads.f30
    /* JADX INFO: renamed from: zza */
    public final void mo5zza() {
        Activity activity = this.f16611e;
        if (activity == null) {
            c("Activity context is not available.");
            return;
        }
        m7.n nVar = m7.n.C;
        p7.r0 r0Var = nVar.f30464c;
        if (!new qn(activity).b(new Intent("android.intent.action.INSERT").setType("vnd.android.cursor.dir/event"))) {
            c("This feature is not available on the device.");
            return;
        }
        AlertDialog.Builder builderJ = p7.r0.j(activity);
        Resources resourcesZzf = nVar.f30469h.zzf();
        builderJ.setTitle(resourcesZzf != null ? resourcesZzf.getString(k7.d.f29077s5) : "Create calendar event");
        builderJ.setMessage(resourcesZzf != null ? resourcesZzf.getString(k7.d.f29078s6) : "Allow Ad to create a calendar event?");
        builderJ.setPositiveButton(resourcesZzf != null ? resourcesZzf.getString(k7.d.f29075s3) : RtspHeaders.ACCEPT, new rx(this, 0));
        builderJ.setNegativeButton(resourcesZzf != null ? resourcesZzf.getString(k7.d.f29076s4) : "Decline", new rx(this, 1));
        builderJ.create().show();
    }
}
