package com.bytedance.sdk.openadsdk.core.model;

import android.text.TextUtils;
import com.bykv.vk.openvk.fm.fm.fm.lb.b;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes2.dex */
public class ai {
    private String ajl;
    private int dsz;
    private int duv;

    /* JADX INFO: renamed from: ef, reason: collision with root package name */
    private int f7155ef;
    private int fhx;
    private int fm;
    private String gof;
    private String irt;
    private String jnr;
    private int ku;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    private boolean f7156lb;
    private int onz;
    private String qhl;
    private int ro;
    private boolean vt;
    private int wsy;
    private int wu;
    private int yz;

    public ai(JSONObject jSONObject) {
        this.duv = 5;
        this.dsz = 5;
        this.onz = 10;
        this.fhx = 20;
        this.irt = "Next Ad";
        this.qhl = "Next ad in %1$ds";
        this.gof = "Play Now";
        if (jSONObject == null) {
            return;
        }
        this.f7156lb = jSONObject.optBoolean("is_playable");
        this.yz = jSONObject.optInt("playable_type", 0);
        this.jnr = jSONObject.optString("playable_style");
        JSONObject jSONObjectOptJSONObject = jSONObject.optJSONObject("playable");
        if (jSONObjectOptJSONObject != null) {
            this.ajl = jSONObjectOptJSONObject.optString("playable_url", "");
            this.wsy = jSONObjectOptJSONObject.optInt("playable_orientation", 0);
            this.ro = jSONObjectOptJSONObject.optInt("new_style", 0);
            this.fm = jSONObjectOptJSONObject.optInt("close_2_app", 0);
            int iFm = fm(this.yz);
            this.wu = jSONObjectOptJSONObject.optInt("playable_webview_timeout", iFm);
            this.f7155ef = jSONObjectOptJSONObject.optInt("playable_js_timeout", iFm);
            this.vt = jSONObjectOptJSONObject.optInt("playable_backup_enable", 0) == 1;
            this.duv = jSONObjectOptJSONObject.optInt("wait_tips_time", 5);
            this.dsz = jSONObjectOptJSONObject.optInt("auto_to_next_time", 5);
            this.onz = jSONObjectOptJSONObject.optInt("next_ad_tips_show_time", 10);
            this.fhx = jSONObjectOptJSONObject.optInt("max_show_time", 20);
            this.qhl = jSONObjectOptJSONObject.optString("next_ad_in_xs");
            this.irt = jSONObjectOptJSONObject.optString("next_ad_text");
            this.gof = jSONObjectOptJSONObject.optString("play_now_text");
            int iOptInt = jSONObjectOptJSONObject.optInt("countdown_show_type", 0);
            this.ku = iOptInt;
            if (iOptInt == 0 || iOptInt == 1 || iOptInt == 2) {
                return;
            }
            this.ku = 0;
        }
    }

    private static int ai(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return 0;
        }
        return aiVarGzf.yz;
    }

    public static boolean dsz(lse lseVar) {
        return true;
    }

    public static String duv(lse lseVar) {
        if (lseVar == null) {
            return null;
        }
        ai aiVarBwv = lseVar.bwv();
        if (aiVarBwv != null && aiVarBwv.f7156lb) {
            String str = aiVarBwv.ajl;
            if (!TextUtils.isEmpty(str)) {
                return str;
            }
        }
        if (lseVar.ywr() == 20) {
            return lseVar.rbn();
        }
        if (lseVar.ex() != null) {
            return lseVar.ex().f5928h;
        }
        return null;
    }

    public static int fhx(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return 0;
        }
        return aiVarGzf.wsy;
    }

    public static long gof(lse lseVar) {
        if (gzf(lseVar) == null) {
            return 5L;
        }
        return r2.wu();
    }

    public static long gqi(lse lseVar) {
        if (gzf(lseVar) == null) {
            return 5L;
        }
        return r2.ef();
    }

    private static ai gzf(lse lseVar) {
        if (lseVar == null) {
            return null;
        }
        return lseVar.bwv();
    }

    public static int hi(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return 0;
        }
        return aiVarGzf.ro();
    }

    public static String hlt(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return null;
        }
        return aiVarGzf.ajl();
    }

    public static boolean irt(lse lseVar) {
        return false;
    }

    public static String ku(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return null;
        }
        return aiVarGzf.ajl;
    }

    public static String lse(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return null;
        }
        return aiVarGzf.wsy();
    }

    public static String maa(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return null;
        }
        return aiVarGzf.jnr();
    }

    public static int mq(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return 0;
        }
        return aiVarGzf.yz();
    }

    public static int nt(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return 0;
        }
        return aiVarGzf.lb();
    }

    public static boolean onz(lse lseVar) {
        b bVarEx = lseVar.ex();
        return bVarEx != null && bVarEx.f5934n == 1;
    }

    public static long qhl(lse lseVar) {
        return Math.max(gof(lseVar), gqi(lseVar));
    }

    public static int sds(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return 0;
        }
        return aiVarGzf.fm();
    }

    public static boolean wey(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        return aiVarGzf != null && aiVarGzf.vt();
    }

    public String ajl() {
        return this.qhl;
    }

    public int ef() {
        return this.f7155ef;
    }

    public int fm() {
        return this.duv;
    }

    public String jnr() {
        return this.irt;
    }

    public int lb() {
        return this.onz;
    }

    public int ro() {
        return this.dsz;
    }

    public boolean vt() {
        return this.vt;
    }

    public String wsy() {
        return this.gof;
    }

    public int wu() {
        return this.wu;
    }

    public int yz() {
        return this.fhx;
    }

    public static boolean ajl(lse lseVar) {
        return jnr(lseVar) && ai(lseVar) == 1;
    }

    public static int ef(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return 0;
        }
        return aiVarGzf.ku;
    }

    private static int fm(int i10) {
        return i10 == 1 ? 10 : 5;
    }

    public static boolean jnr(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        return aiVarGzf != null && lseVar.uw() && aiVarGzf.f7156lb && !TextUtils.isEmpty(duv(lseVar));
    }

    public static boolean lb(lse lseVar) {
        return ro(lseVar) && ai(lseVar) == 1;
    }

    public static boolean ro(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        return (aiVarGzf == null || !aiVarGzf.f7156lb || TextUtils.isEmpty(duv(lseVar))) ? false : true;
    }

    public static String vt(lse lseVar) {
        ai aiVarGzf = gzf(lseVar);
        if (aiVarGzf == null) {
            return null;
        }
        return aiVarGzf.jnr;
    }

    public static boolean wsy(lse lseVar) {
        ai aiVarBwv = lseVar.bwv();
        return aiVarBwv != null && aiVarBwv.f7156lb && aiVarBwv.ro == 1;
    }

    public static boolean wu(lse lseVar) {
        ai aiVarBwv = lseVar.bwv();
        return aiVarBwv != null && lseVar.uw() && aiVarBwv.f7156lb && aiVarBwv.ro == 1;
    }

    public static boolean yz(lse lseVar) {
        return lb(lseVar) && !wsy(lseVar);
    }

    public static int fm(lse lseVar) {
        int i10;
        ai aiVarBwv = lseVar.bwv();
        if (aiVarBwv != null && (i10 = aiVarBwv.fm) >= 0 && i10 <= 100) {
            return i10;
        }
        return 0;
    }
}
