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

import android.content.Context;
import android.net.Uri;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.media3.common.MimeTypes;
import androidx.media3.exoplayer.rtsp.SessionDescription;
import androidx.media3.exoplayer.upstream.CmcdConfiguration;
import com.bykv.vk.openvk.fm.fm.fm.lb.b;
import com.bytedance.sdk.openadsdk.AdSlot;
import com.bytedance.sdk.openadsdk.FilterWord;
import com.bytedance.sdk.openadsdk.TTAdConstant;
import com.bytedance.sdk.openadsdk.api.banner.PAGBannerSize;
import com.bytedance.sdk.openadsdk.utils.bx;
import com.bytedance.sdk.openadsdk.utils.mon;
import com.bytedance.sdk.openadsdk.utils.zan;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import tv.danmaku.ijk.media.player.IjkMediaPlayer;
import xyz.stream.download.config.InnerConstant;

/* JADX INFO: loaded from: classes2.dex */
public final class lse {
    protected static int ku;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    public static final String f7184lb;
    public static final String ro;
    public static final String yz;
    private String ado;
    private String bkb;
    private AdSlot bp;
    private gzf bq;
    private String bwv;
    private com.bytedance.sdk.openadsdk.core.dsz.wu.fm bwz;
    private boolean bxe;

    /* JADX INFO: renamed from: cd, reason: collision with root package name */
    private boolean f7186cd;
    private int cpu;
    private boolean cyr;
    private long daz;
    private String dh;
    private com.bytedance.sdk.openadsdk.core.dsz.wu.fm dnd;
    public long dsz;

    /* JADX INFO: renamed from: ef, reason: collision with root package name */
    protected long f7188ef;
    private int ej;
    private onz eo;
    private int ew;
    private JSONObject ex;
    private String eys;

    /* JADX INFO: renamed from: fb, reason: collision with root package name */
    private nt f7189fb;

    /* JADX INFO: renamed from: ff, reason: collision with root package name */
    private int f7190ff;
    private int fp;
    private boolean gay;

    /* JADX INFO: renamed from: gc, reason: collision with root package name */
    private int f7191gc;
    private jnr gof;
    private String gqi;
    private b grs;
    private String gzf;

    /* JADX INFO: renamed from: ha, reason: collision with root package name */
    private String f7192ha;
    private hlt hi;
    private int hm;
    private boolean hxv;
    private String iat;
    private String ii;
    private ha ij;
    private volatile boolean jk;
    private int jm;
    private b jn;
    private int kh;
    private gof kwx;
    private String lcp;
    private String lmk;
    private String lsa;
    private long lse;
    private int lty;
    private com.bytedance.sdk.openadsdk.core.onz.fm lvj;
    private int lz;
    private long maa;
    private String mj;
    private qhl mlt;
    private fhx mt;
    private String mzr;

    /* JADX INFO: renamed from: ne, reason: collision with root package name */
    private gof f7197ne;
    private int nn;
    private ai nnq;
    private String no;
    private gqi nqr;
    private String oj;
    private com.bytedance.sdk.openadsdk.core.model.fm ol;
    private JSONObject ooo;
    private String op;
    private dsz pbk;
    private String pcm;

    /* JADX INFO: renamed from: pf, reason: collision with root package name */
    private boolean f7198pf;
    private int pg;
    private int pkk;
    private Map<String, Object> po;

    /* JADX INFO: renamed from: qf, reason: collision with root package name */
    private int f7200qf;
    private boolean qhl;
    private String qi;
    private int qph;
    private JSONObject qvb;
    private String rbn;
    private ajl rka;
    private String rok;
    private wsy rr;

    /* JADX INFO: renamed from: se, reason: collision with root package name */
    private int f7201se;
    private int si;
    private int siu;
    private int so;
    private PAGBannerSize ss;
    private boolean tmm;
    private int ucr;
    private String up;
    private boolean uuk;
    private wu uuz;
    private JSONObject vj;
    private fm vod;
    private String wbw;
    private int wey;
    protected int wu;
    private int xgn;
    private String xw;

    /* JADX INFO: renamed from: ya, reason: collision with root package name */
    private int f7204ya;
    private sds ybi;
    private boolean ynh;
    private String yur;
    private String ywr;
    private int zbh;
    private ol zew;
    private boolean zh;
    private b zjk;
    private int zn;
    private String zow;
    private String zp;
    private boolean zt;
    private JSONObject zzm;
    private boolean zzn;
    private long irt = 0;
    protected boolean fm = false;
    protected boolean jnr = com.bytedance.sdk.openadsdk.hi.fm.lb.fm;
    protected int ajl = com.bytedance.sdk.openadsdk.hi.fm.lb.ro;
    protected String wsy = com.bytedance.sdk.openadsdk.hi.fm.lb.f7416lb;
    private int sds = 0;
    private boolean hlt = false;
    private List<String> nt = new ArrayList();
    private int mq = -1;
    private HashMap<String, String> ai = new HashMap<>();
    protected int vt = 0;
    private final List<gof> mon = new ArrayList();
    private final List<String> bx = new ArrayList();
    private final List<FilterWord> zan = new ArrayList();
    private final mon tzk = mon.lb();
    public boolean duv = false;

    /* JADX INFO: renamed from: ib, reason: collision with root package name */
    private int f7193ib = 0;
    private List<String> mpp = new ArrayList();
    private List<String> vvj = new ArrayList();
    private String aws = SessionDescription.SUPPORTED_SDP_VERSION;

    /* JADX INFO: renamed from: qb, reason: collision with root package name */
    private String f7199qb = "";

    /* JADX INFO: renamed from: te, reason: collision with root package name */
    private int f7202te = 0;
    private int cg = 2;
    private int xca = -1;
    private int ttj = 0;
    private int wjb = 0;
    private int ky = 1;
    private ku oy = new ku();

    /* JADX INFO: renamed from: kc, reason: collision with root package name */
    private int f7195kc = -200;
    private int ug = 0;

    /* JADX INFO: renamed from: le, reason: collision with root package name */
    private int f7196le = 1;
    private int pyj = 0;
    private int xp = 0;
    private int hou = 0;
    private int qlg = 1;
    private int zes = 1;
    private float anz = 100.0f;
    private int gt = -1;
    private int kec = 2;

    /* JADX INFO: renamed from: cc, reason: collision with root package name */
    private int f7185cc = 1;
    private int mu = 0;
    private int nk = 1;
    private int nss = -1;
    private long gfn = -1;

    /* JADX INFO: renamed from: ce, reason: collision with root package name */
    private int f7187ce = 0;
    private int il = Integer.MIN_VALUE;
    private boolean kw = false;
    private int gz = 0;
    private int npg = -1;
    private int olu = -1;

    /* JADX INFO: renamed from: ie, reason: collision with root package name */
    private long f7194ie = -1;
    private int bm = 50;

    /* JADX INFO: renamed from: vc, reason: collision with root package name */
    private int f7203vc = -1;
    private final ro oxv = new ro();
    private boolean vu = false;
    private int cll = 0;
    private com.bytedance.sdk.openadsdk.hi.fm.ro cjb = null;
    protected int onz = -1;
    protected int fhx = -1;
    private float vrt = -1.0f;

    public static class fm {
        private String ajl;
        private String dsz;
        private String duv;

        /* JADX INFO: renamed from: ef, reason: collision with root package name */
        private String f7205ef;
        private String fm;
        private String jnr;
        private String ku;

        /* JADX INFO: renamed from: lb, reason: collision with root package name */
        private String f7206lb;
        private String onz;
        private String ro;
        private String vt;
        private String wsy;
        private List<Integer> wu;
        private String yz;

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

        public String dsz() {
            return this.duv;
        }

        public void duv(String str) {
            this.dsz = str;
        }

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

        public String fhx() {
            return this.onz;
        }

        public List<Integer> fm() {
            return this.wu;
        }

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

        public String ku() {
            return this.vt;
        }

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

        public String onz() {
            return this.dsz;
        }

        public String ro() {
            return this.f7205ef;
        }

        public String vt() {
            return this.ku;
        }

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

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

        public String yz() {
            return this.fm;
        }

        public void ajl(String str) {
            this.yz = str;
        }

        public void dsz(String str) {
            this.onz = str;
        }

        public boolean duv() {
            return !TextUtils.isEmpty(this.vt) && this.vt.equals("v3");
        }

        public void ef(String str) {
            this.ku = str;
        }

        public void fm(String str) {
            this.f7205ef = str;
        }

        public void jnr(String str) {
            this.f7206lb = str;
        }

        public void ku(String str) {
            this.duv = str;
        }

        public void lb(String str) {
            this.fm = str;
        }

        public void ro(String str) {
            this.ajl = str;
        }

        public void vt(String str) {
            this.vt = str;
        }

        public void wsy(String str) {
            this.jnr = str;
        }

        public void wu(String str) {
            this.wsy = str;
        }

        public void yz(String str) {
            this.ro = str;
        }

        @NonNull
        public static com.bytedance.sdk.openadsdk.core.dsz.wu.fm ro(fm fmVar, String str) {
            return new com.bytedance.sdk.openadsdk.core.dsz.wu.fm().fm(fmVar.yz()).ro(fmVar.onz()).lb(fmVar.dsz()).yz(fmVar.fhx()).jnr(str);
        }

        public void fm(List<Integer> list) {
            this.wu = list;
        }

        @NonNull
        public static com.bytedance.sdk.component.adexpress.fm.lb.yz fm(fm fmVar, String str) {
            return com.bytedance.sdk.component.adexpress.fm.lb.yz.fm().fm(fmVar.yz()).ro(fmVar.jnr()).lb(fmVar.ajl()).yz(fmVar.wsy()).jnr(fmVar.lb()).ajl(str);
        }
    }

    static {
        CharSequence[] charSequenceArr = {"is", bx.ol()};
        StringBuilder sb = new StringBuilder();
        sb.append(charSequenceArr[0]);
        sb.append((CharSequence) "_");
        sb.append(charSequenceArr[1]);
        ro = sb.toString();
        CharSequence[] charSequenceArr2 = {"is", bx.ol(), "sample"};
        StringBuilder sb2 = new StringBuilder();
        sb2.append(charSequenceArr2[0]);
        for (int i10 = 1; i10 < 3; i10++) {
            sb2.append((CharSequence) "_");
            sb2.append(charSequenceArr2[i10]);
        }
        f7184lb = sb2.toString();
        CharSequence[] charSequenceArr3 = {bx.ol(), "strategy"};
        StringBuilder sb3 = new StringBuilder();
        sb3.append(charSequenceArr3[0]);
        sb3.append((CharSequence) "_");
        sb3.append(charSequenceArr3[1]);
        yz = sb3.toString();
        ku = 330;
    }

    public lse() {
        com.bytedance.sdk.openadsdk.core.model.fm fmVar = new com.bytedance.sdk.openadsdk.core.model.fm();
        this.ol = fmVar;
        fmVar.fm(this);
    }

    private com.bytedance.sdk.openadsdk.core.dsz.wu.fm ijn() {
        fm fmVarZzn = zzn();
        if (fmVarZzn == null) {
            return null;
        }
        return fm.ro(fmVarZzn, String.valueOf(pg()));
    }

    private com.bytedance.sdk.openadsdk.core.dsz.wu.fm tt() {
        ha haVarPo = po();
        if (haVarPo == null) {
            return null;
        }
        return new com.bytedance.sdk.openadsdk.core.dsz.wu.fm().fm(haVarPo.fm()).ro(haVarPo.ro()).lb(haVarPo.lb()).yz(haVarPo.yz()).jnr(pg() + "_v3");
    }

    public void ado(int i10) {
        this.cll = i10;
    }

    @NonNull
    public List<lse> afy() {
        return this.ol.jnr();
    }

    public String ai() {
        return this.op;
    }

    public void ajl(int i10) {
        this.vt = i10;
    }

    public String anz() {
        return this.gqi;
    }

    public HashMap<String, String> avr() {
        return this.ai;
    }

    public int aws() {
        return this.f7185cc;
    }

    public int ay() {
        return this.sds;
    }

    public int bh() {
        Map<String, Object> map = this.po;
        if (map == null) {
            return 0;
        }
        try {
            Object obj = map.get(TTAdConstant.SDK_BIDDING_TYPE);
            if (obj != null) {
                return Integer.parseInt(obj.toString());
            }
            return 0;
        } catch (Throwable unused) {
            return 0;
        }
    }

    public void bkb(int i10) {
        this.mu = i10;
    }

    public long bm() {
        if (this.gfn < 0) {
            JSONObject jSONObjectOlu = olu();
            if (jSONObjectOlu != null) {
                this.gfn = jSONObjectOlu.optLong("ad_id", 0L);
            } else {
                this.gfn = 0L;
            }
        }
        return this.gfn;
    }

    public int bp() {
        return this.fp;
    }

    public boolean bq() {
        return cpu() != null && cpu().getDurationSlotType() == 8 && yur();
    }

    public ai bwv() {
        return this.nnq;
    }

    public fhx bwz() {
        return this.mt;
    }

    public void bx(int i10) {
        this.f7204ya = i10;
    }

    public b bxe() {
        return this.grs;
    }

    public ol cap() {
        return this.zew;
    }

    public long cc() {
        return this.daz;
    }

    public int cd() {
        return this.so;
    }

    public boolean ce() {
        return this.zbh == 1;
    }

    public int cg() {
        return this.ky;
    }

    public boolean cjb() {
        return this.duv;
    }

    public long cll() {
        return this.dsz;
    }

    public AdSlot cpu() {
        return this.bp;
    }

    public int cyr() {
        JSONObject jSONObject;
        int i10 = this.il;
        return (Integer.MIN_VALUE != i10 || (jSONObject = this.ooo) == null) ? i10 : jSONObject.optInt("click_trigger_type", 0);
    }

    public int daz() {
        if (zn()) {
            return 5;
        }
        if (lvj() != 100.0f || no() == 2) {
            return 0;
        }
        return this.ug;
    }

    public boolean dbt() {
        gqi gqiVar;
        if (this.bp == null || (gqiVar = this.nqr) == null) {
            return false;
        }
        return gqiVar.fm(!TextUtils.isEmpty(r0.getBidAdm()));
    }

    public boolean dh() {
        return ie() == 3 || ie() == 4;
    }

    public int dnd() {
        return this.ej;
    }

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

    public String duv() {
        return this.f7192ha;
    }

    public ro dwu() {
        return this.oxv;
    }

    public long ef() {
        return this.irt;
    }

    public boolean ej() {
        return zn() || this.gof != null;
    }

    public List<String> ejh() {
        return this.nt;
    }

    public boolean emt() {
        return this.vu;
    }

    public String eo() {
        return this.aws;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj != null && lse.class == obj.getClass()) {
            lse lseVar = (lse) obj;
            if (this.aws.equals(lseVar.eo()) && this.zow.equals(lseVar.gt())) {
                return true;
            }
        }
        return false;
    }

    public long er() {
        return this.maa;
    }

    public List<FilterWord> ew() {
        return this.zan;
    }

    public b ex() {
        return this.jn;
    }

    public String eys() {
        if (!TextUtils.isEmpty(this.bwv)) {
            return this.bwv;
        }
        Context contextFm = com.bytedance.sdk.openadsdk.core.gof.fm();
        int iOy = oy();
        if (iOy != 2 && iOy != 3) {
            if (iOy == 4) {
                return contextFm != null ? com.bytedance.sdk.component.utils.maa.fm(contextFm, "tt_video_download_apk") : this.bwv;
            }
            if (iOy != 8) {
                return this.bwv;
            }
        }
        return contextFm != null ? com.bytedance.sdk.component.utils.maa.fm(contextFm, "tt_video_mobile_go_detail") : this.bwv;
    }

    public int fb() {
        return this.f7187ce;
    }

    public gof ff() {
        return this.f7197ne;
    }

    public void fhx(int i10) {
        this.xca = i10;
    }

    public hlt fm() {
        return this.hi;
    }

    public double fp() {
        return ef(olu());
    }

    public void fy() {
        if (!TextUtils.isEmpty(xca())) {
            onz(SessionDescription.SUPPORTED_SDP_VERSION);
        }
        Map<String, Object> mapKh = kh();
        if (mapKh == null || !mapKh.containsKey("price")) {
            return;
        }
        mapKh.put("price", SessionDescription.SUPPORTED_SDP_VERSION);
    }

    public b gay() {
        return this.zjk;
    }

    public com.bytedance.sdk.openadsdk.core.dsz.wu.fm gc() {
        return this.dnd;
    }

    public int gfn() {
        return this.siu;
    }

    public int gof() {
        return this.vt;
    }

    public void gqi(int i10) {
        this.wjb = i10;
    }

    public String grs() {
        return this.lsa;
    }

    public String gt() {
        return this.zow;
    }

    public int gz() {
        return this.nk;
    }

    public String gzf() {
        return this.up;
    }

    public void ha(int i10) {
        this.pg = i10;
    }

    public long hfj() {
        return this.f7188ef;
    }

    public wu hi() {
        return this.uuz;
    }

    public sds hlt() {
        return this.ybi;
    }

    public boolean hm() {
        fm fmVar = this.vod;
        if (fmVar != null) {
            return !TextUtils.isEmpty(fmVar.ku());
        }
        int i10 = this.wjb;
        return i10 == 9 || i10 == 10 || i10 == 11;
    }

    public List<String> hou() {
        return this.mpp;
    }

    public void hxv(int i10) {
        this.jm = i10;
    }

    public ajl iat() {
        return this.rka;
    }

    public String ib() {
        JSONObject jSONObjectOlu;
        if (this.dh == null && (jSONObjectOlu = olu()) != null) {
            this.dh = jSONObjectOlu.optString(CmcdConfiguration.KEY_CONTENT_ID, "");
        }
        return this.dh;
    }

    public int ie() {
        if (this.nss < 0) {
            JSONObject jSONObjectOlu = olu();
            if (jSONObjectOlu != null) {
                this.nss = jSONObjectOlu.optInt("ad_slot_type", 0);
            } else {
                this.nss = 0;
            }
        }
        return this.nss;
    }

    public boolean ii() {
        return ie() == 7;
    }

    public int ij() {
        return this.hm;
    }

    public int il() {
        return this.mu;
    }

    public void irt(int i10) {
        this.cg = i10;
    }

    public nt jd() {
        return this.f7189fb;
    }

    public int jk() {
        return this.f7204ya;
    }

    public int jm() {
        return this.f7202te;
    }

    public int jn() {
        return this.f7195kc;
    }

    public void jnr(int i10) {
        this.olu = i10;
    }

    public boolean kc() {
        return this.lty == 1;
    }

    public String kec() {
        return this.xw;
    }

    public Map<String, Object> kh() {
        return this.po;
    }

    @Nullable
    public yz kl() {
        yz yzVarDsz;
        jnr jnrVar = this.gof;
        if (jnrVar != null) {
            yzVarDsz = jnrVar.ro();
        } else {
            com.bytedance.sdk.openadsdk.core.onz.fm fmVar = this.lvj;
            yzVarDsz = fmVar != null ? fmVar.dsz() : null;
        }
        if (yzVarDsz != null) {
            yzVarDsz.fm(this);
        }
        return yzVarDsz;
    }

    public String ku() {
        return this.wbw;
    }

    public int kw() {
        return this.kh;
    }

    public void kwx(int i10) {
        this.hm = i10;
    }

    public String ky() {
        return this.pcm;
    }

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

    public int lcp() {
        return this.xca;
    }

    public gof le() {
        return this.kwx;
    }

    public void lmk(int i10) {
        this.kh = i10;
    }

    public String lo() {
        return this.qi;
    }

    public int lsa() {
        onz onzVar = this.eo;
        if (onzVar == null) {
            return 0;
        }
        return onzVar.fm();
    }

    public void lse(int i10) {
        this.ug = i10;
    }

    public boolean lty() {
        return ie() == 5;
    }

    public float lvj() {
        if (this.anz <= 0.0f) {
            this.anz = 100.0f;
        }
        return (this.anz * 1000.0f) / 1000.0f;
    }

    public void lz(int i10) {
        this.siu = i10;
    }

    public String maa() {
        return this.mzr;
    }

    public boolean mcl() {
        return this.jnr;
    }

    public boolean mh() {
        nt ntVar = this.f7189fb;
        if (ntVar == null || ntVar.ro() != 1) {
            return false;
        }
        hlt hltVar = this.hi;
        return hltVar == null || hltVar.fm() <= 0;
    }

    public void mj(int i10) {
        this.f7187ce = i10;
    }

    public int mlt() {
        return this.ttj;
    }

    public int mon() {
        return this.gz;
    }

    public wsy mpp() {
        return this.rr;
    }

    public void mq(int i10) {
        this.nn = i10;
    }

    public com.bytedance.sdk.openadsdk.core.onz.fm mt() {
        return this.lvj;
    }

    public boolean mu() {
        return this.cyr;
    }

    public int mv() {
        return this.npg;
    }

    public int mxq() {
        int i10 = this.onz;
        return i10 >= 0 ? i10 : com.bytedance.sdk.openadsdk.core.gof.yz().wey(String.valueOf(pg()));
    }

    public String mzr() {
        return this.rok;
    }

    public String ne() {
        return this.ii;
    }

    public long nfc() {
        Map<String, Object> mapKh = kh();
        if (mapKh == null) {
            return 0L;
        }
        try {
            Object obj = mapKh.get("media_share_price");
            if (obj == null) {
                return 0L;
            }
            return Long.parseLong(obj.toString());
        } catch (Exception unused) {
            return 0L;
        }
    }

    public JSONObject nk() {
        return this.vj;
    }

    public String nn() {
        return this.ado;
    }

    public int nnq() {
        if (this.zes != 2) {
            this.zes = 1;
        }
        return this.zes;
    }

    public int no() {
        int i10;
        if (this.wjb == 11 && (i10 = this.cg) == 2) {
            return i10;
        }
        int i11 = this.f7200qf;
        if (i11 == 5 || i11 == 6 || i11 == 33) {
            return 1;
        }
        if (bq()) {
            return 2;
        }
        return this.cg;
    }

    public boolean npg() {
        b bVar = this.jn;
        return bVar == null || bVar.f5933m != 1;
    }

    public mon nqr() {
        return this.tzk;
    }

    public int nss() {
        int i10 = this.gt;
        if (i10 >= 0) {
            return i10;
        }
        return 30;
    }

    public gqi nt() {
        return this.nqr;
    }

    public boolean oj() {
        return this.jk;
    }

    public void ol(int i10) {
        this.lty = i10;
    }

    public JSONObject olu() {
        if (this.ex == null) {
            try {
                if (!TextUtils.isEmpty(this.zow)) {
                    this.ex = new JSONObject(this.zow);
                }
            } catch (JSONException e10) {
                com.bytedance.sdk.component.utils.wey.lb("MaterialMeta", e10.getMessage());
            }
        }
        return this.ex;
    }

    public void onz(int i10) {
        this.f7202te = i10;
    }

    public com.bytedance.sdk.component.ef.ro.fm ooo() {
        com.bytedance.sdk.component.ef.ro.fm fmVar = new com.bytedance.sdk.component.ef.ro.fm();
        fmVar.ro(this.ucr);
        fmVar.ro(this.aws);
        fmVar.lb(this.lcp);
        fmVar.fm(gt());
        fmVar.fm(this.wjb);
        return fmVar;
    }

    public void op() {
        this.jk = true;
    }

    public int osn() {
        return this.ajl;
    }

    public boolean oxv() {
        fhx fhxVar;
        return zn() && !vu() && (fhxVar = this.mt) != null && fhxVar.fm() == 1;
    }

    public int oy() {
        return this.lz;
    }

    @Nullable
    public jnr pa() {
        return this.gof;
    }

    public String pbk() {
        return this.f7199qb;
    }

    public int pcm() {
        return this.si;
    }

    public boolean pf() {
        return zjk() == 100 || this.f7200qf == 20;
    }

    public int pg() {
        JSONObject jSONObjectOlu = olu();
        if (jSONObjectOlu != null) {
            return jSONObjectOlu.optInt("rit", 0);
        }
        return 0;
    }

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

    public String pkk() {
        return this.oj;
    }

    public ha po() {
        return this.ij;
    }

    public List<gof> pyj() {
        return this.mon;
    }

    public gzf pz() {
        return this.bq;
    }

    public PAGBannerSize pzl() {
        return this.ss;
    }

    public int qb() {
        return this.hou;
    }

    public void qf(int i10) {
        this.ew = i10;
    }

    public long qhl() {
        return this.f7194ie;
    }

    public void qi() {
        this.tzk.jnr();
        wsy(false);
    }

    public String qlg() {
        return this.mj;
    }

    public ku qph() {
        return this.oy;
    }

    public int qu() {
        int i10 = this.mq;
        return i10 >= 0 ? i10 : ii() ? 30 : 5;
    }

    public boolean qvb() {
        return !zn() && mlt() == 1;
    }

    public String rbn() {
        return this.bkb;
    }

    public int rka() {
        return this.kec;
    }

    public void ro(double d10) {
        if (d10 == 2.0d || d10 == 1.0d) {
            this.kec = (int) d10;
        } else {
            this.kec = 2;
        }
    }

    public boolean rok() {
        if (this.mon.isEmpty()) {
            return false;
        }
        if (this.jm == 4 && this.mon.size() < 3) {
            return false;
        }
        Iterator<gof> it = this.mon.iterator();
        while (it.hasNext()) {
            if (!it.next().jnr()) {
                return false;
            }
        }
        return true;
    }

    public int rr() {
        JSONObject jSONObject = this.qvb;
        if (jSONObject != null) {
            return jSONObject.optInt("easy_playable_skip_duration", 0);
        }
        return 0;
    }

    public String sds() {
        return this.yur;
    }

    public boolean se() {
        return ie() == 1;
    }

    public int si() {
        return this.bm;
    }

    public int siu() {
        return this.jm;
    }

    public int so() {
        return this.f7193ib;
    }

    public String ss() {
        JSONObject jSONObjectOlu;
        String strOptString = this.zp;
        if (TextUtils.isEmpty(strOptString) && (jSONObjectOlu = olu()) != null) {
            strOptString = jSONObjectOlu.optString("req_id", "");
            ha(strOptString);
        }
        return strOptString == null ? "" : strOptString;
    }

    public int te() {
        return this.wjb;
    }

    public int tmm() {
        return this.nss;
    }

    public int ttj() {
        return this.xp;
    }

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

    public void tzk(int i10) {
        this.mq = i10;
    }

    public boolean uav() {
        return this.hlt;
    }

    public JSONObject ucr() {
        return this.ooo;
    }

    public long uf() {
        return this.lse;
    }

    public boolean ug() {
        return this.pg == 1;
    }

    public qhl up() {
        return this.mlt;
    }

    public boolean uui() {
        int i10 = this.si;
        return i10 == 44 || i10 == 43;
    }

    public String uuk() {
        return this.ywr;
    }

    public int uuv() {
        String strValueOf;
        com.bytedance.sdk.openadsdk.core.model.fm fmVarYz = yz();
        if (fmVarYz != null && fmVarYz.ku() != null) {
            return fmVarYz.ku().ef();
        }
        if (cpu() != null) {
            strValueOf = cpu().getCodeId();
        } else {
            int iPg = pg();
            strValueOf = iPg != 0 ? String.valueOf(iPg) : null;
        }
        if (strValueOf != null) {
            return com.bytedance.sdk.openadsdk.core.gof.yz().duv(strValueOf);
        }
        return 30;
    }

    @Nullable
    public String uuz() {
        ajl ajlVarIat = iat();
        if (ajlVarIat == null || TextUtils.isEmpty(ajlVarIat.fm())) {
            return null;
        }
        return ajlVarIat.fm();
    }

    public boolean uw() {
        return true;
    }

    public boolean vc() {
        return ie() == 8;
    }

    public int vg() {
        String strValueOf;
        com.bytedance.sdk.openadsdk.core.model.fm fmVarYz = yz();
        if (fmVarYz != null && fmVarYz.ku() != null) {
            return fmVarYz.ku().ef();
        }
        if (cpu() != null) {
            strValueOf = cpu().getCodeId();
        } else {
            int iPg = pg();
            strValueOf = iPg != 0 ? String.valueOf(iPg) : null;
        }
        if (strValueOf != null) {
            return com.bytedance.sdk.openadsdk.core.gof.yz().wey(strValueOf);
        }
        return 5;
    }

    public List<String> vj() {
        return this.vvj;
    }

    public com.bytedance.sdk.openadsdk.hi.fm.ro vm() {
        return this.cjb;
    }

    public com.bytedance.sdk.component.adexpress.fm.lb.yz vod() {
        fm fmVarZzn = zzn();
        if (fmVarZzn == null) {
            return null;
        }
        return fm.fm(fmVarZzn, String.valueOf(pg()));
    }

    public boolean vrt() {
        return this.kw;
    }

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

    public int vt() {
        return this.wey;
    }

    public boolean vu() {
        return this.tzk.fm > 0;
    }

    public void vvj(int i10) {
        this.so = i10;
    }

    public void wbw(int i10) {
        this.lz = i10;
    }

    public int we() {
        int i10 = this.fhx;
        return i10 >= 0 ? i10 : com.bytedance.sdk.openadsdk.core.gof.yz().ku(String.valueOf(pg()));
    }

    public void wey(int i10) {
        this.ky = i10;
    }

    public String wf() {
        return this.gzf;
    }

    public String wjb() {
        return this.no;
    }

    public int wsy() {
        return this.xgn;
    }

    public void wu(int i10) {
        this.bm = i10;
    }

    public boolean wzb() {
        hlt hltVar = this.hi;
        return hltVar != null && hltVar.fm() > 0;
    }

    public String xca() {
        return this.eys;
    }

    public float xe() {
        float f10 = this.vrt;
        if (f10 > 0.0f) {
            return f10;
        }
        ha haVar = this.ij;
        if (haVar != null) {
            String strYz = haVar.yz();
            if (TextUtils.isEmpty(strYz)) {
                strYz = com.bytedance.sdk.openadsdk.core.dsz.fm.ro.fm().fm("adv3", this.ij.fm(), this.ij.ro());
            }
            if (strYz != null) {
                try {
                    JSONObject jSONObjectOptJSONObject = new JSONObject(strYz).optJSONObject("body");
                    if (jSONObjectOptJSONObject != null) {
                        float fOptDouble = (float) jSONObjectOptJSONObject.optDouble("ratio");
                        this.vrt = fOptDouble;
                        return fOptDouble;
                    }
                } catch (JSONException unused) {
                }
            }
        }
        this.vrt = 0.0f;
        return 0.0f;
    }

    public com.bytedance.sdk.openadsdk.core.dsz.wu.fm xgn() {
        return this.bwz;
    }

    public int xio() {
        return this.cll;
    }

    public String xp() {
        return this.lmk;
    }

    public String xw() {
        return this.bwv;
    }

    public dsz ya() {
        return this.pbk;
    }

    public JSONObject ybi() {
        return this.zzm;
    }

    public int ynh() {
        return this.zn;
    }

    public boolean yur() {
        return this.f7187ce == 2;
    }

    public boolean yw() {
        return this.fm;
    }

    public int ywr() {
        return this.f7200qf;
    }

    public com.bytedance.sdk.openadsdk.core.model.fm yz() {
        return this.ol;
    }

    public void zan(int i10) {
        this.gt = i10;
    }

    public JSONObject zbh() {
        JSONObject jSONObjectDsz = dsz(false);
        JSONObject jSONObjectGqi = com.bytedance.sdk.openadsdk.core.settings.ku.ro().gqi(String.valueOf(pg()));
        JSONObject jSONObject = new JSONObject();
        try {
            JSONArray jSONArray = new JSONArray();
            jSONArray.put(jSONObjectDsz);
            jSONObject.put("creatives", jSONArray);
            jSONObject.put("did", 1);
            jSONObject.put("processing_time_ms", 100);
            jSONObject.put("request_id", "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa");
            jSONObject.put("s_receive_ts", 1);
            jSONObject.put("s_send_ts", 1);
            jSONObject.put("status_code", 20000);
            jSONObject.put("core_settings", jSONObjectGqi);
        } catch (JSONException e10) {
            com.bytedance.sdk.component.utils.wey.lb("MaterialMeta", "toJsonObjPlus", e10.getMessage());
        }
        return jSONObject;
    }

    public String zes() {
        return this.lcp;
    }

    public boolean zew() {
        int i10 = this.f7200qf;
        return (i10 == 2 || i10 == 1) && 3 == this.lz;
    }

    public int zh() {
        return this.ucr;
    }

    public int zjk() {
        return this.cpu;
    }

    public boolean zn() {
        int i10 = this.f7187ce;
        return (i10 == 1 || i10 == 3) && mt() != null;
    }

    public boolean zow() {
        return this.pyj == 1;
    }

    public int zp() {
        return this.ew;
    }

    public JSONObject zt() {
        return this.qvb;
    }

    public List<String> zzm() {
        return this.bx;
    }

    public fm zzn() {
        return this.vod;
    }

    public static boolean pbk(int i10) {
        return i10 == 44 || i10 == 43 || i10 == 30 || i10 == 40 || i10 == 41 || i10 == 39;
    }

    public long ado() {
        wsy wsyVar = this.rr;
        if (wsyVar == null) {
            return 0L;
        }
        return wsyVar.lb();
    }

    public void ai(int i10) {
        this.ucr = i10;
    }

    public void ajl(long j10) {
        this.maa = j10;
    }

    public void aws(int i10) {
        this.sds = i10;
    }

    public boolean bkb() {
        if (this.nss <= 0) {
            this.nss = ie();
        }
        int i10 = this.nss;
        return (i10 == 7 || i10 == 8) && !jnr(this) && pcm() != 21 && this.f7201se == 1;
    }

    public void bwv(int i10) {
        this.wu = i10;
    }

    public boolean bx() {
        return this.bxe;
    }

    public void dsz(int i10) {
        this.si = i10;
    }

    public void duv(int i10) {
        this.f7200qf = i10;
    }

    public void ef(int i10) {
        this.f7201se = i10;
    }

    public void fhx(String str) {
        this.lsa = str;
    }

    public void fm(double d10) {
        if (d10 == 2.0d || d10 == 1.0d) {
            this.f7185cc = (int) d10;
        } else {
            this.f7185cc = 1;
        }
    }

    public void gc(int i10) {
        this.qph = i10;
    }

    public void gof(int i10) {
        this.hou = i10;
    }

    public void gqi(String str) {
        this.lmk = str;
    }

    public void gzf(int i10) {
        this.cpu = i10;
    }

    public void ha(String str) {
        this.zp = str;
    }

    public void hi(int i10) {
        this.f7195kc = i10;
    }

    public void hlt(int i10) {
        this.f7190ff = i10;
    }

    public boolean hxv() {
        return this.ynh;
    }

    public void irt(String str) {
        this.no = str;
    }

    public void jnr(long j10) {
        this.f7188ef = j10;
    }

    public void ku(int i10) {
        this.f7193ib = i10;
    }

    public int kwx() {
        if (this.f7203vc < 0) {
            try {
                JSONObject jSONObjectOlu = olu();
                if (jSONObjectOlu != null) {
                    this.f7203vc = jSONObjectOlu.optInt("is_drop_to_retargeting_sample", 0);
                } else {
                    this.f7203vc = 0;
                }
            } catch (Throwable unused) {
                this.f7203vc = 0;
            }
        }
        return this.f7203vc;
    }

    public void lb(int i10) {
        this.wey = i10;
    }

    public void lmk() {
        b bVar = this.jn;
        if (bVar == null || TextUtils.isEmpty(bVar.f5928h)) {
            return;
        }
        try {
            if (!this.jn.f5928h.contains("style_id")) {
                this.ynh = false;
            } else {
                this.ynh = true;
                this.oj = Uri.parse(this.jn.f5928h).getQueryParameters("style_id").get(0);
            }
        } catch (Throwable th) {
            com.bytedance.sdk.component.utils.wey.lb(th.getMessage(), new Object[0]);
        }
    }

    public void lse(String str) {
        this.aws = str;
    }

    public boolean lz() {
        return this.f7186cd;
    }

    public void maa(int i10) {
        this.f7196le = i10;
    }

    public int mj() {
        if (ol()) {
            return 5;
        }
        return yur() ? 4 : 1;
    }

    public void mon(int i10) {
        this.ttj = i10;
    }

    public void mpp(int i10) {
        this.nk = i10;
    }

    public void mq(String str) {
        this.xw = str;
    }

    public void ne(int i10) {
        this.ej = i10;
    }

    public void nt(int i10) {
        this.qlg = i10;
    }

    public void ol(String str) {
        this.ywr = str;
    }

    public void onz(String str) {
        this.eys = str;
    }

    public void pcm(int i10) {
        this.onz = i10;
    }

    public void pkk(int i10) {
        this.fp = i10;
    }

    public boolean qf() {
        return this.tmm;
    }

    public void qhl(int i10) {
        this.pyj = i10;
    }

    public void rka(int i10) {
        this.npg = i10;
    }

    public void ro(int i10) {
        this.xgn = i10;
    }

    public void sds(int i10) {
        this.xp = i10;
    }

    public void si(int i10) {
        this.zbh = i10;
    }

    public void so(int i10) {
        this.fhx = i10;
    }

    public int tzk() {
        try {
            JSONObject jSONObjectOlu = olu();
            if (jSONObjectOlu != null) {
                return jSONObjectOlu.optInt("rec_clk", 0);
            }
            return 0;
        } catch (Exception unused) {
            return 0;
        }
    }

    public void vt(String str) {
        this.op = str;
    }

    public int vvj() {
        wsy wsyVar = this.rr;
        if (wsyVar == null) {
            return 2;
        }
        return wsyVar.ro();
    }

    public boolean wbw() {
        JSONArray jSONArrayOptJSONArray;
        JSONObject jSONObjectUcr = ucr();
        if (jSONObjectUcr != null && (jSONArrayOptJSONArray = jSONObjectUcr.optJSONArray("tag_ids")) != null) {
            for (int i10 = 0; i10 < jSONArrayOptJSONArray.length(); i10++) {
                if (jSONArrayOptJSONArray.optInt(i10) == 174) {
                    return true;
                }
            }
        }
        return false;
    }

    public void wey(String str) {
        this.mj = str;
    }

    public void wsy(int i10) {
        this.gz = i10;
    }

    public void wu(String str) {
        this.mzr = str;
    }

    public void xgn(int i10) {
        this.zes = i10;
    }

    public void ywr(int i10) {
        if (i10 < 0 || i10 > 30) {
            i10 = 6;
        }
        this.ajl = i10;
    }

    public void yz(int i10) {
        this.pkk = i10;
    }

    public boolean zan() {
        return this.gay;
    }

    private String mon(String str) {
        try {
            if (TextUtils.isEmpty(str)) {
                return null;
            }
            return com.bytedance.sdk.component.utils.irt.fm(str);
        } catch (Throwable th) {
            com.bytedance.sdk.component.utils.wey.lb("MaterialMeta", "generate icon key error", th.getMessage());
            return null;
        }
    }

    public void ai(String str) {
        this.rok = str;
    }

    public void ajl(String str) {
        this.f7192ha = str;
    }

    public void dsz(String str) {
        this.iat = str;
    }

    public void duv(String str) {
        this.f7199qb = str;
    }

    public void ef(String str) {
        this.up = str;
    }

    public void fhx(boolean z10) {
        this.kw = z10;
    }

    public void fm(float f10) {
        this.anz = f10;
    }

    public void gc(String str) {
        if (TextUtils.isEmpty(str)) {
            return;
        }
        this.nt.add(str);
    }

    public void gof(String str) {
        this.bkb = str;
    }

    public void gqi(boolean z10) {
        this.hlt = z10;
    }

    public void gzf(String str) {
        this.rbn = str;
    }

    public boolean ha() {
        JSONArray jSONArrayOptJSONArray;
        JSONObject jSONObjectUcr = ucr();
        if (jSONObjectUcr == null || (jSONArrayOptJSONArray = jSONObjectUcr.optJSONArray("tag_ids")) == null) {
            return false;
        }
        for (int i10 = 0; i10 < jSONArrayOptJSONArray.length(); i10++) {
            if (jSONArrayOptJSONArray.optInt(i10) == 186) {
                return true;
            }
        }
        return false;
    }

    public void hi(String str) {
        this.gqi = str;
    }

    public void hlt(String str) {
        this.lcp = str;
    }

    public void hxv(String str) {
        if (TextUtils.isEmpty(str)) {
            this.wsy = com.bytedance.sdk.openadsdk.hi.fm.lb.f7416lb;
        } else {
            this.wsy = str;
        }
    }

    public void ib(int i10) {
        this.zn = Math.max(0, i10);
    }

    public void irt(boolean z10) {
        this.fm = z10;
    }

    public void jnr(String str) {
        this.wbw = str;
    }

    public void ku(String str) {
        this.ii = str;
    }

    public void lb(long j10) {
        this.daz = j10;
    }

    public boolean lse() {
        return (TextUtils.isEmpty(sds()) || TextUtils.isEmpty(maa())) ? false : true;
    }

    public void maa(String str) {
        this.bwv = str;
    }

    public boolean mq() {
        return this.zt;
    }

    public void nt(String str) {
        this.zow = str;
    }

    public boolean ol() {
        JSONArray jSONArrayOptJSONArray;
        List<Integer> listFm;
        if (zzn() != null && (listFm = zzn().fm()) != null && listFm.contains(57)) {
            return true;
        }
        JSONObject jSONObjectUcr = ucr();
        if (jSONObjectUcr != null && (jSONArrayOptJSONArray = jSONObjectUcr.optJSONArray("tag_ids")) != null) {
            for (int i10 = 0; i10 < jSONArrayOptJSONArray.length(); i10++) {
                if (jSONArrayOptJSONArray.optInt(i10) == 57) {
                    return true;
                }
            }
        }
        return false;
    }

    public void onz(boolean z10) {
        this.duv = z10;
    }

    public void pkk(String str) {
        this.qi = str;
    }

    public void qhl(String str) {
        this.pcm = str;
    }

    public void ro(long j10) {
        this.f7194ie = j10;
    }

    public void sds(String str) {
        this.ado = str;
    }

    public void vt(boolean z10) {
        this.f7186cd = z10;
    }

    public boolean wey() {
        return this.zh;
    }

    public void wsy(long j10) {
        this.lse = j10;
    }

    public void wu(boolean z10) {
        this.bxe = z10;
    }

    public void xgn(String str) {
        this.gzf = str;
    }

    public void yz(long j10) {
        this.dsz = j10;
    }

    public void ajl(JSONObject jSONObject) {
        this.qvb = jSONObject;
    }

    public JSONObject dsz(boolean z10) {
        try {
            String strLo = lo();
            if (TextUtils.isEmpty(strLo)) {
                return null;
            }
            JSONObject jSONObject = new JSONObject();
            if (z10) {
                jSONObject.put("raw_response_info", strLo);
            }
            JSONArray jSONArrayOptJSONArray = new JSONObject(strLo).optJSONArray("creatives");
            if (jSONArrayOptJSONArray != null && lb() >= 0 && lb() < jSONArrayOptJSONArray.length()) {
                JSONObject jSONObjectOptJSONObject = jSONArrayOptJSONArray.optJSONObject(lb());
                if (jSONObjectOptJSONObject != null) {
                    Iterator<String> itKeys = jSONObjectOptJSONObject.keys();
                    while (itKeys.hasNext()) {
                        String next = itKeys.next();
                        jSONObject.put(next, jSONObjectOptJSONObject.get(next));
                    }
                }
                AdSlot adSlotCpu = cpu();
                if (adSlotCpu != null) {
                    jSONObject.put("adslot", adSlotCpu.toJsonObj());
                }
                if (!TextUtils.isEmpty(this.up)) {
                    jSONObject.put("gdid_encrypted", this.up);
                }
                jSONObject.put("hasReportShow", this.f7186cd);
                jSONObject.put("isMrcReportFinish", this.jk);
                return jSONObject;
            }
            return null;
        } catch (Exception e10) {
            com.bytedance.sdk.component.utils.wey.fm("MaterialMeta", "toJsonObj error", e10);
            return null;
        }
    }

    public void duv(boolean z10) {
        this.cyr = z10;
    }

    public void ef(boolean z10) {
        this.gay = z10;
    }

    public boolean fhx() {
        return this.hxv;
    }

    public void fm(int i10) {
        this.f7191gc = i10;
    }

    public void gof(boolean z10) {
        this.jnr = z10;
    }

    public boolean gqi() {
        return this.f7198pf;
    }

    public boolean irt() {
        return this.uuk;
    }

    public void jnr(boolean z10) {
        this.zh = z10;
    }

    public void ku(boolean z10) {
        this.tmm = z10;
    }

    public void lb(b bVar) {
        this.zjk = bVar;
    }

    public boolean onz() {
        return this.qhl;
    }

    public void qhl(boolean z10) {
        this.vu = z10;
    }

    public void ro(b bVar) {
        this.grs = bVar;
    }

    public void vt(int i10) {
        fm(i10, -1);
    }

    public void wsy(String str) {
        this.yur = str;
    }

    public String wu() {
        hi hiVarKu;
        com.bytedance.sdk.openadsdk.core.model.fm fmVarYz = yz();
        if (fmVarYz == null || (hiVarKu = fmVarYz.ku()) == null) {
            return null;
        }
        return hiVarKu.wsy();
    }

    public void yz(JSONObject jSONObject) {
        this.zzm = jSONObject;
    }

    private static double ef(JSONObject jSONObject) {
        if (jSONObject != null) {
            return jSONObject.optDouble("pack_time", 0.0d);
        }
        return 0.0d;
    }

    public void ajl(boolean z10) {
        this.zzn = z10;
    }

    public void fm(long j10) {
        this.irt = j10;
    }

    public String jnr() {
        int iTmm = tmm();
        return iTmm != 1 ? iTmm != 3 ? iTmm != 5 ? iTmm != 7 ? iTmm != 8 ? "unknown" : "fullscreen_interstitial_ad" : "rewarded_video" : "embeded_ad" : "open_ad" : "banner_ad";
    }

    public void lb(JSONObject jSONObject) {
        this.vj = jSONObject;
    }

    public void ro(gof gofVar) {
        this.kwx = gofVar;
    }

    public void wsy(boolean z10) {
        this.zt = z10;
    }

    public void yz(boolean z10) {
        this.f7198pf = z10;
    }

    public static boolean jnr(lse lseVar) {
        if (lseVar == null) {
            return false;
        }
        int iSiu = lseVar.siu();
        return lseVar.zn() || iSiu == 5 || iSiu == 15 || iSiu == 50;
    }

    public static boolean yz(lse lseVar) {
        return (lseVar == null || lseVar.ex() == null || lseVar.ex().f5931k != 1) ? false : true;
    }

    public boolean ajl() {
        nt ntVar;
        int iYwr = ywr();
        if (qf() && ai.lb(this) && iYwr != 43 && iYwr != 44) {
            return false;
        }
        if (!qf() && pbk(iYwr) && (ntVar = this.f7189fb) != null && ntVar.fm() == 1) {
            return false;
        }
        boolean z10 = (iYwr == 33 || iYwr == 5 || iYwr == 6 || iYwr == 19 || iYwr == 12) ? false : true;
        if (zn() || no() == 2 || !z10 || !com.bytedance.sdk.openadsdk.core.dsz.ajl.fm.ajl.fm(bx.lb(this.nss))) {
            return no() == 2 && z10;
        }
        return true;
    }

    public void fm(b bVar) {
        this.jn = bVar;
    }

    public void lb(boolean z10) {
        this.uuk = z10;
    }

    public void ro(JSONObject jSONObject) {
        this.ooo = jSONObject;
    }

    public String wbw(String str) {
        JSONObject jSONObjectOlu = olu();
        return jSONObjectOlu != null ? jSONObjectOlu.optString("rit", str) : str;
    }

    public void wsy(JSONObject jSONObject) {
        this.oxv.fm(jSONObject);
    }

    public static boolean lb(lse lseVar) {
        return (lseVar == null || lseVar.ex() == null || lseVar.ex().f5932l != 7 || ai.ro(lseVar)) ? false : true;
    }

    private static long wu(JSONObject jSONObject) {
        if (jSONObject != null) {
            return jSONObject.optLong("uid", 0L);
        }
        return 0L;
    }

    public void fm(AdSlot adSlot) {
        this.bp = adSlot;
    }

    public void ro(boolean z10) {
        this.hxv = z10;
    }

    public void fm(PAGBannerSize pAGBannerSize) {
        this.ss = pAGBannerSize;
    }

    public void jnr(JSONObject jSONObject) {
        if (jSONObject == null) {
            return;
        }
        this.lz = 4;
        this.aws = jSONObject.optString(InnerConstant.Db.f36069id);
        this.no = jSONObject.optString("source");
        ajl ajlVar = new ajl();
        this.rka = ajlVar;
        ajlVar.lb(jSONObject.optString("pkg_name"));
        this.rka.ro(jSONObject.optString("name"));
        this.rka.fm(jSONObject.optString("download_url"));
    }

    public int ro() {
        wsy wsyVarMpp = mpp();
        if (wsyVarMpp != null) {
            return wsyVarMpp.fm();
        }
        return -1;
    }

    public static int yz(String str) {
        return fm(lb(str));
    }

    public void fm(ai aiVar) {
        this.nnq = aiVar;
    }

    public static JSONObject lb(String str) {
        if (!TextUtils.isEmpty(str)) {
            try {
                return new JSONObject(str);
            } catch (JSONException e10) {
                com.bytedance.sdk.component.utils.wey.lb("MaterialMeta", e10.getMessage());
            }
        }
        return null;
    }

    public static boolean ro(lse lseVar) {
        return (fm(lseVar) || lb(lseVar)) ? false : true;
    }

    public void fm(ajl ajlVar) {
        this.rka = ajlVar;
    }

    public static double ro(String str) {
        return ef(lb(str));
    }

    public void fm(dsz dszVar) {
        this.pbk = dszVar;
    }

    public static boolean ajl(lse lseVar) {
        Object obj;
        if (lseVar == null) {
            return false;
        }
        try {
            Map<String, Object> mapKh = lseVar.kh();
            if (mapKh == null || (obj = mapKh.get(TTAdConstant.SDK_BIDDING_TYPE)) == null) {
                return false;
            }
            return 2 == Integer.parseInt(obj.toString());
        } catch (Throwable th) {
            th.getMessage();
            return false;
        }
    }

    public void fm(fhx fhxVar) {
        this.mt = fhxVar;
    }

    public static String ro(Context context, lse lseVar) {
        if (context != null && lseVar != null) {
            try {
                if (lseVar.oy() != 8) {
                    if (lseVar.hi().fm()) {
                    }
                }
                String strFm = com.bytedance.sdk.openadsdk.core.fm.fm.fm(context);
                if (TextUtils.isEmpty(strFm)) {
                    return null;
                }
                return strFm;
            } catch (Throwable th) {
                com.bytedance.sdk.component.utils.wey.lb("MaterialMeta", th.getMessage());
            }
        }
        return null;
    }

    public void fm(com.bytedance.sdk.openadsdk.core.model.fm fmVar) {
        if (fmVar != null) {
            this.ol = fmVar;
        }
    }

    public void lb(gof gofVar) {
        PAGBannerSize pAGBannerSizePzl = pzl();
        if (pAGBannerSizePzl != null && pAGBannerSizePzl.getWidth() > 0 && pAGBannerSizePzl.getHeight() > 0) {
            fm(gofVar, zan.ro(com.bytedance.sdk.openadsdk.core.gof.fm(), pAGBannerSizePzl.getWidth()), zan.ro(com.bytedance.sdk.openadsdk.core.gof.fm(), pAGBannerSizePzl.getHeight()));
        }
        this.mon.add(gofVar);
    }

    public void fm(gqi gqiVar) {
        this.nqr = gqiVar;
    }

    public void fm(gzf gzfVar) {
        this.bq = gzfVar;
    }

    public void fm(hlt hltVar) {
        this.hi = hltVar;
    }

    public void fm(jnr jnrVar) {
        this.gof = jnrVar;
    }

    public void ro(com.bytedance.sdk.openadsdk.core.dsz.wu.fm fmVar) {
        this.bwz = fmVar;
        com.bytedance.sdk.openadsdk.core.dsz.fm.ro.fm().fm(fmVar, "endcard");
    }

    public static void ro(lse lseVar, JSONObject jSONObject) throws JSONException {
        ajl ajlVarIat = lseVar.iat();
        if (ajlVarIat != null) {
            JSONObject jSONObject2 = new JSONObject();
            jSONObject2.put("app_name", ajlVarIat.ro());
            jSONObject2.put("package_name", ajlVarIat.lb());
            jSONObject2.put("download_url", ajlVarIat.fm());
            jSONObject2.put("score", ajlVarIat.yz());
            jSONObject2.put("comment_num", ajlVarIat.jnr());
            jSONObject2.put("app_size", ajlVarIat.ajl());
            jSONObject2.put("app_category", ajlVarIat.wsy());
            jSONObject.put("app", jSONObject2);
        }
    }

    public void fm(ku kuVar) {
        this.oy = kuVar;
    }

    public void fm(nt ntVar) {
        this.f7189fb = ntVar;
    }

    public void fm(ol olVar) {
        this.zew = olVar;
    }

    public void fm(onz onzVar) {
        this.eo = onzVar;
    }

    public void fm(qhl qhlVar) {
        this.mlt = qhlVar;
    }

    public void fm(sds sdsVar) {
        this.ybi = sdsVar;
    }

    public void fm(wsy wsyVar) {
        this.rr = wsyVar;
    }

    public void fm(wu wuVar) {
        this.uuz = wuVar;
    }

    public void fm(com.bytedance.sdk.openadsdk.core.onz.fm fmVar) {
        this.lvj = fmVar;
    }

    public void fm(com.bytedance.sdk.openadsdk.hi.fm.ro roVar) {
        this.cjb = roVar;
    }

    public void fm(Map<String, Object> map) {
        this.po = map;
    }

    public void fm(boolean z10) {
        this.qhl = z10;
    }

    public static boolean fm(lse lseVar, boolean z10, boolean z11, boolean z12, boolean z13) {
        if (fm(lseVar) || z13 || lseVar == null || lseVar.ex() == null || TextUtils.isEmpty(lseVar.ex().f5928h)) {
            return false;
        }
        return lb(lseVar) ? z12 : (lseVar.ex() == null || lseVar.ex().f5931k != 1) ? z10 : z11;
    }

    public static boolean fm(lse lseVar) {
        return (lseVar == null || lseVar.ex() == null || lseVar.ex().f5932l != 1) ? false : true;
    }

    public static com.bytedance.sdk.openadsdk.core.fhx.fm.ro fm(String str, lse lseVar) {
        int i10;
        boolean z10 = false;
        lseVar.bkb(0);
        int iIe = lseVar.ie();
        int i11 = 3;
        if (iIe == 3) {
            i11 = 4;
        } else {
            if (iIe == 7) {
                i10 = 1;
                com.bytedance.sdk.openadsdk.core.fhx.fm.ro roVar = new com.bytedance.sdk.openadsdk.core.fhx.fm.ro(str, lseVar.bxe(), lseVar.gay(), lseVar.il(), lseVar.kw(), i10);
                roVar.fm(com.bytedance.sdk.openadsdk.hlt.jnr.fm("video_error_conf", 0));
                String strIrt = roVar.irt();
                if (o6.b.f31431h && strIrt != null && strIrt.endsWith(".mp4")) {
                    z10 = true;
                }
                roVar.lb(z10);
                return roVar;
            }
            if (iIe == 8) {
                i11 = 2;
            }
        }
        i10 = i11;
        com.bytedance.sdk.openadsdk.core.fhx.fm.ro roVar2 = new com.bytedance.sdk.openadsdk.core.fhx.fm.ro(str, lseVar.bxe(), lseVar.gay(), lseVar.il(), lseVar.kw(), i10);
        roVar2.fm(com.bytedance.sdk.openadsdk.hlt.jnr.fm("video_error_conf", 0));
        String strIrt2 = roVar2.irt();
        if (o6.b.f31431h) {
            z10 = true;
        }
        roVar2.lb(z10);
        return roVar2;
    }

    public static long fm(String str) {
        return wu(lb(str));
    }

    public static int fm(JSONObject jSONObject) {
        if (jSONObject != null) {
            return jSONObject.optInt("ut", 0);
        }
        return 0;
    }

    public static String fm(Context context, lse lseVar) {
        if (context == null || lseVar == null || !((lseVar.ie() == 8 || lseVar.ie() == 7) && lseVar.pf())) {
            return null;
        }
        String strRo = ro(context, lseVar);
        if (TextUtils.isEmpty(strRo) || com.bytedance.sdk.openadsdk.core.fm.fm.fm() != 1) {
            return null;
        }
        return strRo;
    }

    public void fm(com.bytedance.sdk.openadsdk.core.dsz.wu.fm fmVar) {
        this.dnd = fmVar;
        com.bytedance.sdk.openadsdk.core.dsz.fm.ro.fm().fm(fmVar, "endcard");
    }

    public void fm(int i10, int i11) {
        this.si = i10;
        this.f7200qf = i10;
        if (this.bp == null) {
            this.f7200qf = 0;
            return;
        }
        if (i11 <= 0) {
            i11 = ie();
        }
        if (this.bp.getDurationSlotType() == 3 || i11 == 3) {
            this.f7200qf = 14;
            return;
        }
        if (this.bp.getDurationSlotType() != 7 && this.bp.getDurationSlotType() != 8 && i11 != 7 && i11 != 8) {
            if (!this.tmm && ai.ro(this)) {
                this.f7200qf = 4;
                return;
            }
            if (this.si == 4 && !ai.ro(this)) {
                this.f7200qf = 0;
            }
            int i12 = this.si;
            if (i12 == 41) {
                this.f7200qf = 41;
                return;
            }
            if (i10 >= 5) {
                this.f7200qf = 0;
                return;
            }
            if (i12 == 2 && oy() != 3) {
                this.f7200qf = 0;
                return;
            } else {
                if (i10 == 0 || (i10 == 1 && oy() != 3)) {
                    this.f7200qf = 0;
                    return;
                }
                return;
            }
        }
        if (!this.tmm) {
            if (ai.lb(this)) {
                this.f7200qf = 12;
                return;
            } else if (ai.ro(this)) {
                this.f7200qf = 9;
                return;
            }
        }
        if (this.si == 5 && !wey.yz(this)) {
            this.f7200qf = 7;
        }
        if (this.si == 6 && !wey.ro(this)) {
            this.f7200qf = 7;
        }
        if (this.si == 8 && zjk() != 100) {
            this.f7200qf = 7;
        }
        if (this.si == 19 && TextUtils.isEmpty(this.bkb)) {
            this.f7200qf = 7;
        }
        if (this.si == 20 && TextUtils.isEmpty(this.bkb)) {
            this.f7200qf = 7;
        }
        if (this.si == 38 && !wey.lb(this)) {
            this.f7200qf = 7;
        }
        if (i10 < 5) {
            this.f7200qf = 7;
        }
    }

    public void fm(fm fmVar) {
        this.vod = fmVar;
        com.bytedance.sdk.component.adexpress.fm.lb.yz yzVarVod = vod();
        if (yzVarVod != null && !hm()) {
            com.bytedance.sdk.component.adexpress.fm.ro.ro.fm(yzVarVod);
        }
        if (fmVar == null || TextUtils.isEmpty(fmVar.dsz())) {
            return;
        }
        com.bytedance.sdk.openadsdk.core.dsz.fm.ro.fm().fm(ijn(), "ad");
    }

    public void fm(ha haVar) {
        this.ij = haVar;
        if (haVar == null || TextUtils.isEmpty(haVar.lb())) {
            return;
        }
        com.bytedance.sdk.openadsdk.core.dsz.fm.ro.fm().fm(tt(), "adv3");
    }

    public void fm(gof gofVar) {
        fm(gofVar, ku);
        String strMon = mon(gofVar.fm());
        if (!TextUtils.isEmpty(strMon)) {
            gofVar.ro(strMon);
        }
        this.f7197ne = gofVar;
    }

    private void fm(gof gofVar, int i10) {
        if (gofVar != null) {
            try {
                if (TextUtils.isEmpty(gofVar.fm())) {
                    return;
                }
                if (gofVar.ro() == 0 && gofVar.lb() == 0) {
                    gofVar.fm(i10);
                    gofVar.ro(i10);
                    return;
                }
                if (gofVar.ro() == 0) {
                    if (gofVar.lb() > i10) {
                        gofVar.ro(i10);
                        gofVar.fm(i10);
                        return;
                    } else {
                        gofVar.fm(gofVar.lb());
                        return;
                    }
                }
                if (gofVar.lb() == 0) {
                    if (gofVar.ro() > i10) {
                        gofVar.ro(i10);
                        gofVar.fm(i10);
                        return;
                    } else {
                        gofVar.ro(gofVar.ro());
                        return;
                    }
                }
                if (gofVar.ro() > gofVar.lb()) {
                    if (gofVar.ro() > i10) {
                        gofVar.ro((int) (i10 / (gofVar.ro() / gofVar.lb())));
                        gofVar.fm(i10);
                        return;
                    }
                    return;
                }
                if (gofVar.lb() > i10) {
                    gofVar.fm((int) (i10 * (gofVar.ro() / gofVar.lb())));
                    gofVar.ro(i10);
                }
            } catch (Throwable unused) {
            }
        }
    }

    private void fm(gof gofVar, int i10, int i11) {
        try {
            if (gofVar.lb() >= i11) {
                gofVar.fm((int) ((gofVar.ro() / gofVar.lb()) * i11));
                gofVar.ro(i11);
            } else if (gofVar.ro() >= i10) {
                gofVar.fm((int) ((i10 / i11) * gofVar.lb()));
            }
        } catch (Throwable unused) {
        }
    }

    public void fm(FilterWord filterWord) {
        this.zan.add(filterWord);
    }

    public void fm(HashMap<String, String> map) {
        if (map == null || map.isEmpty()) {
            return;
        }
        this.ai = map;
    }

    public static void fm(lse lseVar, JSONObject jSONObject) throws JSONException {
        List<gof> listPyj = lseVar.pyj();
        if (listPyj != null) {
            JSONArray jSONArray = new JSONArray();
            for (gof gofVar : listPyj) {
                JSONObject jSONObject2 = new JSONObject();
                jSONObject2.put(IjkMediaPlayer.OnNativeInvokeListener.ARG_URL, gofVar.fm());
                jSONObject2.put("height", gofVar.lb());
                jSONObject2.put("width", gofVar.ro());
                jSONObject2.put("image_preview", gofVar.ajl());
                jSONObject2.put("image_key", gofVar.wsy());
                jSONArray.put(jSONObject2);
            }
            jSONObject.put(MimeTypes.BASE_TYPE_IMAGE, jSONArray);
        }
    }
}
