package u1;

import Z.g;
import android.graphics.Color;
import d5.AbstractC0844a;
import x0.AbstractC1709a;

/* JADX INFO: renamed from: u1.d, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C1593d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final String f17424a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final int f17425b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Integer f17426c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final Integer f17427d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final float f17428e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final boolean f17429f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final boolean f17430g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final boolean f17431h;
    public final boolean i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final int f17432j;

    public C1593d(String str, int i, Integer num, Integer num2, float f3, boolean z8, boolean z9, boolean z10, boolean z11, int i5) {
        this.f17424a = str;
        this.f17425b = i;
        this.f17426c = num;
        this.f17427d = num2;
        this.f17428e = f3;
        this.f17429f = z8;
        this.f17430g = z9;
        this.f17431h = z10;
        this.i = z11;
        this.f17432j = i5;
    }

    public static int a(String str) {
        boolean z8;
        try {
            int i = Integer.parseInt(str.trim());
            switch (i) {
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case g.STRING_SET_FIELD_NUMBER /* 6 */:
                case g.DOUBLE_FIELD_NUMBER /* 7 */:
                case g.BYTES_FIELD_NUMBER /* 8 */:
                case 9:
                    z8 = true;
                    break;
                default:
                    z8 = false;
                    break;
            }
            if (z8) {
                return i;
            }
        } catch (NumberFormatException unused) {
        }
        AbstractC0844a.v("Ignoring unknown alignment: ", str, "SsaStyle");
        return -1;
    }

    public static boolean b(String str) {
        try {
            int i = Integer.parseInt(str);
            return i == 1 || i == -1;
        } catch (NumberFormatException e8) {
            AbstractC1709a.C("SsaStyle", "Failed to parse boolean value: '" + str + "'", e8);
            return false;
        }
    }

    public static Integer c(String str) {
        try {
            long j8 = str.startsWith("&H") ? Long.parseLong(str.substring(2), 16) : Long.parseLong(str);
            AbstractC1709a.d(j8 <= 4294967295L);
            return Integer.valueOf(Color.argb(W3.b.h(((j8 >> 24) & 255) ^ 255), W3.b.h(j8 & 255), W3.b.h((j8 >> 8) & 255), W3.b.h((j8 >> 16) & 255)));
        } catch (IllegalArgumentException e8) {
            AbstractC1709a.C("SsaStyle", "Failed to parse color expression: '" + str + "'", e8);
            return null;
        }
    }
}
