package com.chartboost.sdk.impl;

import android.text.TextUtils;
/* loaded from: classes2.dex */
public abstract class nd {
    public static void a() {
        if (!q7.b()) {
            throw new IllegalStateException("Method called before OM SDK activation");
        }
    }

    public static void b(bc bcVar) {
        if (bcVar.i()) {
            throw new IllegalStateException("AdSession is finished");
        }
    }

    public static void c(bc bcVar) {
        if (bcVar.n()) {
            throw new IllegalStateException("AdSession is started");
        }
    }

    public static void d(bc bcVar) {
        if (!bcVar.n()) {
            throw new IllegalStateException("AdSession is not started");
        }
    }

    public static void e(bc bcVar) {
        if (!bcVar.l()) {
            throw new IllegalStateException("Impression event is not expected from the Native AdSession");
        }
    }

    public static void f(bc bcVar) {
        if (!bcVar.m()) {
            throw new IllegalStateException("Cannot create MediaEvents for JavaScript AdSession");
        }
    }

    public static void g(bc bcVar) {
        if (bcVar.k().c() != null) {
            throw new IllegalStateException("AdEvents already exists for AdSession");
        }
    }

    public static void h(bc bcVar) {
        if (bcVar.k().d() != null) {
            throw new IllegalStateException("MediaEvents already exists for AdSession");
        }
    }

    public static void a(f8 f8Var, q3 q3Var, o6 o6Var) {
        if (f8Var == f8.NONE) {
            throw new IllegalArgumentException("Impression owner is none");
        }
        if (q3Var == q3.DEFINED_BY_JAVASCRIPT && f8Var == f8.NATIVE) {
            throw new IllegalArgumentException("ImpressionType/CreativeType can only be defined as DEFINED_BY_JAVASCRIPT if Impression Owner is JavaScript");
        }
        if (o6Var == o6.DEFINED_BY_JAVASCRIPT && f8Var == f8.NATIVE) {
            throw new IllegalArgumentException("ImpressionType/CreativeType can only be defined as DEFINED_BY_JAVASCRIPT if Impression Owner is JavaScript");
        }
    }

    public static void a(bc bcVar) {
        d(bcVar);
        b(bcVar);
    }

    public static void a(Object obj, String str) {
        if (obj == null) {
            throw new IllegalArgumentException(str);
        }
    }

    public static void a(String str, int i, String str2) {
        if (str.length() > i) {
            throw new IllegalArgumentException(str2);
        }
    }

    public static void a(String str, String str2) {
        if (TextUtils.isEmpty(str)) {
            throw new IllegalArgumentException(str2);
        }
    }
}
