package l5;

import k5.P;
import k5.e0;

/* JADX INFO: loaded from: classes3.dex */
public abstract class n {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final k5.B f20355a = P.a(e0.f20048a, "kotlinx.serialization.json.JsonUnquotedLiteral");

    public static final C a(Number number) {
        return new s(number, false, null);
    }

    public static final C b(String str) {
        return str == null ? v.INSTANCE : new s(str, true, null);
    }

    public static final void c(String str, m mVar) {
        throw new IllegalArgumentException("Element " + kotlin.jvm.internal.D.a(mVar.getClass()) + " is not a " + str);
    }

    public static final Boolean d(C c6) {
        kotlin.jvm.internal.o.h(c6, "<this>");
        String strG = c6.g();
        String[] strArr = m5.z.f21309a;
        kotlin.jvm.internal.o.h(strG, "<this>");
        if (strG.equalsIgnoreCase("true")) {
            return Boolean.TRUE;
        }
        if (strG.equalsIgnoreCase("false")) {
            return Boolean.FALSE;
        }
        return null;
    }

    public static final int e(C c6) {
        kotlin.jvm.internal.o.h(c6, "<this>");
        try {
            long jH = new m5.y(c6.g()).h();
            if (-2147483648L <= jH && jH <= 2147483647L) {
                return (int) jH;
            }
            throw new NumberFormatException(c6.g() + " is not an Int");
        } catch (m5.i e6) {
            throw new NumberFormatException(e6.getMessage());
        }
    }

    public static final e f(m mVar) {
        kotlin.jvm.internal.o.h(mVar, "<this>");
        e eVar = mVar instanceof e ? (e) mVar : null;
        if (eVar != null) {
            return eVar;
        }
        c("JsonArray", mVar);
        throw null;
    }

    public static final y g(m mVar) {
        kotlin.jvm.internal.o.h(mVar, "<this>");
        y yVar = mVar instanceof y ? (y) mVar : null;
        if (yVar != null) {
            return yVar;
        }
        c("JsonObject", mVar);
        throw null;
    }

    public static final C h(m mVar) {
        kotlin.jvm.internal.o.h(mVar, "<this>");
        C c6 = mVar instanceof C ? (C) mVar : null;
        if (c6 != null) {
            return c6;
        }
        c("JsonPrimitive", mVar);
        throw null;
    }
}
