package com.bytedance.adsdk.ugeno.yz.ro;

import android.text.TextUtils;
import com.bytedance.adsdk.ugeno.yz.ajl;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public abstract class fm {
    public static final HashSet<String> fm = new HashSet<>(Arrays.asList("convert", "dislike", "openAppPermission", "openAppPolicy", "openPrivacy", "openAppFunction", "close", "skip", "videoControl", "pauseVideo", "resumeVideo", "muteVideo", "preventEvent"));
    protected Map<String, Object> ajl;
    protected String jnr;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    protected com.bytedance.adsdk.ugeno.ro.lb f6426lb;
    protected ajl.fm ro;
    protected String wsy;
    protected String wu;
    protected String yz;

    /* JADX INFO: renamed from: com.bytedance.adsdk.ugeno.yz.ro.fm$fm, reason: collision with other inner class name */
    public static class C0024fm {
        public static fm fm(com.bytedance.adsdk.ugeno.ro.lb lbVar, String str, ajl.fm fmVar) {
            if (fmVar == null) {
                return null;
            }
            com.bytedance.adsdk.ugeno.yz.ro roVarFm = com.bytedance.adsdk.ugeno.yz.yz.fm(fmVar.ro());
            if (roVarFm == null && (TextUtils.isEmpty(fmVar.fm()) || !TextUtils.equals(fmVar.fm(), "global"))) {
                roVarFm = com.bytedance.adsdk.ugeno.yz.yz.fm(fmVar.jnr());
            }
            if (roVarFm == null) {
                return new lb(lbVar, str, fmVar);
            }
            fm fmVarFm = roVarFm.fm(lbVar, str, fmVar);
            return fmVarFm == null ? new lb(lbVar, str, fmVar) : fmVarFm;
        }
    }

    public fm(com.bytedance.adsdk.ugeno.ro.lb lbVar, String str, ajl.fm fmVar) {
        this.f6426lb = lbVar;
        this.ro = fmVar;
        this.wsy = str;
        jnr();
    }

    private void jnr() {
        ajl.fm fmVar = this.ro;
        if (fmVar == null) {
            return;
        }
        this.yz = fmVar.fm();
        this.jnr = this.ro.ro();
        Map<String, Object> mapLb = this.ro.lb();
        this.ajl = mapLb;
        if (mapLb == null || mapLb.isEmpty() || !this.ajl.containsKey("emitCustomEvent") || !(this.ajl.get("emitCustomEvent") instanceof String)) {
            return;
        }
        this.wu = (String) this.ajl.get("emitCustomEvent");
    }

    public abstract void fm();

    public void lb() {
        if (yz()) {
            ajl.fm fmVar = new ajl.fm();
            fmVar.fm("custom");
            fmVar.ro("emit");
            HashMap map = new HashMap();
            map.put("name", this.wu);
            fmVar.fm(map);
            new ro(this.f6426lb, this.jnr, fmVar).fm();
        }
    }

    public void ro() {
        lb();
    }

    public boolean yz() {
        return !TextUtils.isEmpty(this.wu);
    }
}
