package defpackage;

import android.graphics.Rect;
import androidx.media3.exoplayer.upstream.CmcdData;
import androidx.media3.extractor.text.ttml.TtmlNode;
import defpackage.i05;
import defpackage.y55;
import java.util.ArrayList;
import java.util.HashMap;

/* JADX INFO: loaded from: classes.dex */
public class fk5 {
    public static final i05.a a = i05.a.a("w", CmcdData.STREAMING_FORMAT_HLS, "ip", "op", "fr", "v", "layers", "assets", "fonts", "chars", "markers");
    public static final i05.a b = i05.a.a(TtmlNode.ATTR_ID, "layers", "w", CmcdData.STREAMING_FORMAT_HLS, TtmlNode.TAG_P, "u");
    public static final i05.a c = i05.a.a("list");
    public static final i05.a d = i05.a.a("cm", "tm", "dr");

    public static zj5 a(i05 i05Var) {
        float f;
        float f2;
        float f3;
        float f4;
        float f5;
        float f6;
        float fC = sda.c();
        hj5 hj5Var = new hj5();
        ArrayList arrayList = new ArrayList();
        HashMap map = new HashMap();
        HashMap map2 = new HashMap();
        HashMap map3 = new HashMap();
        ArrayList arrayList2 = new ArrayList();
        wy8 wy8Var = new wy8();
        zj5 zj5Var = new zj5();
        i05Var.b();
        float fN = 0.0f;
        int iN = 0;
        int iN2 = 0;
        float fN2 = 0.0f;
        float fN3 = 0.0f;
        while (i05Var.k()) {
            float f7 = fC;
            switch (i05Var.ad(a)) {
                case 0:
                    f = fN;
                    iN = (int) i05Var.n();
                    fC = f7;
                    fN = f;
                    break;
                case 1:
                    f = fN;
                    iN2 = (int) i05Var.n();
                    fC = f7;
                    fN = f;
                    break;
                case 2:
                    f = fN;
                    fN2 = (float) i05Var.n();
                    fC = f7;
                    fN = f;
                    break;
                case 3:
                    f = fN;
                    fN3 = ((float) i05Var.n()) - 0.01f;
                    fC = f7;
                    fN = f;
                    break;
                case 4:
                    fN = (float) i05Var.n();
                    fC = f7;
                    break;
                case 5:
                    f = fN;
                    f2 = fN2;
                    f3 = fN3;
                    String[] strArrSplit = i05Var.w().split("\\.");
                    int i = Integer.parseInt(strArrSplit[0]);
                    int i2 = Integer.parseInt(strArrSplit[1]);
                    int i3 = Integer.parseInt(strArrSplit[2]);
                    if (i < 4 || (i <= 4 && (i2 < 4 || (i2 <= 4 && i3 < 0)))) {
                        zj5Var.a("Lottie only supports bodymovin >= 4.4.0");
                    }
                    fC = f7;
                    fN2 = f2;
                    fN3 = f3;
                    fN = f;
                    break;
                case 6:
                    f = fN;
                    f2 = fN2;
                    f3 = fN3;
                    i05Var.a();
                    int i4 = 0;
                    while (i05Var.k()) {
                        y55 y55VarA = a65.a(i05Var, zj5Var);
                        if (y55VarA.e == y55.a.b) {
                            i4++;
                        }
                        arrayList.add(y55VarA);
                        hj5Var.g(y55VarA.d, y55VarA);
                        if (i4 > 4) {
                            gh5.b("You have " + i4 + " images. Lottie should primarily be used with shapes. If you are using Adobe Illustrator, convert the Illustrator layers to shape layers.");
                        }
                    }
                    i05Var.d();
                    fC = f7;
                    fN2 = f2;
                    fN3 = f3;
                    fN = f;
                    break;
                case 7:
                    f = fN;
                    f2 = fN2;
                    f3 = fN3;
                    i05Var.a();
                    while (i05Var.k()) {
                        ArrayList arrayList3 = new ArrayList();
                        hj5 hj5Var2 = new hj5();
                        i05Var.b();
                        String strW = null;
                        String strW2 = null;
                        String strW3 = null;
                        int iP = 0;
                        int iP2 = 0;
                        while (i05Var.k()) {
                            int iAd = i05Var.ad(b);
                            if (iAd == 0) {
                                strW = i05Var.w();
                            } else if (iAd == 1) {
                                i05Var.a();
                                while (i05Var.k()) {
                                    y55 y55VarA2 = a65.a(i05Var, zj5Var);
                                    hj5Var2.g(y55VarA2.d, y55VarA2);
                                    arrayList3.add(y55VarA2);
                                }
                                i05Var.d();
                            } else if (iAd == 2) {
                                iP = i05Var.p();
                            } else if (iAd == 3) {
                                iP2 = i05Var.p();
                            } else if (iAd == 4) {
                                strW2 = i05Var.w();
                            } else if (iAd != 5) {
                                i05Var.af();
                                i05Var.ah();
                            } else {
                                strW3 = i05Var.w();
                            }
                        }
                        i05Var.h();
                        if (strW2 != null) {
                            map2.put(strW, new nk5(strW, iP, strW2, strW3, iP2));
                        } else {
                            map.put(strW, arrayList3);
                        }
                    }
                    i05Var.d();
                    fC = f7;
                    fN2 = f2;
                    fN3 = f3;
                    fN = f;
                    break;
                case 8:
                    f = fN;
                    f2 = fN2;
                    float f8 = fN3;
                    i05Var.b();
                    while (i05Var.k()) {
                        if (i05Var.ad(c) != 0) {
                            i05Var.af();
                            i05Var.ah();
                        } else {
                            i05Var.a();
                            while (i05Var.k()) {
                                i05.a aVar = bh3.a;
                                i05Var.b();
                                String strW4 = null;
                                String strW5 = null;
                                String strW6 = null;
                                while (i05Var.k()) {
                                    int iAd2 = i05Var.ad(bh3.a);
                                    if (iAd2 != 0) {
                                        float f9 = f8;
                                        if (iAd2 == 1) {
                                            strW5 = i05Var.w();
                                        } else if (iAd2 == 2) {
                                            strW6 = i05Var.w();
                                        } else if (iAd2 != 3) {
                                            i05Var.af();
                                            i05Var.ah();
                                        } else {
                                            i05Var.n();
                                        }
                                        f8 = f9;
                                    } else {
                                        strW4 = i05Var.w();
                                    }
                                }
                                i05Var.h();
                                map3.put(strW5, new wg3(strW4, strW5, strW6));
                                f8 = f8;
                            }
                            i05Var.d();
                        }
                    }
                    f3 = f8;
                    i05Var.h();
                    fC = f7;
                    fN2 = f2;
                    fN3 = f3;
                    fN = f;
                    break;
                case 9:
                    f = fN;
                    f2 = fN2;
                    f4 = fN3;
                    i05Var.a();
                    while (i05Var.k()) {
                        i05.a aVar2 = ah3.a;
                        ArrayList arrayList4 = new ArrayList();
                        i05Var.b();
                        double dN = 0.0d;
                        String strW7 = null;
                        String strW8 = null;
                        char cCharAt = 0;
                        while (i05Var.k()) {
                            int iAd3 = i05Var.ad(ah3.a);
                            if (iAd3 == 0) {
                                cCharAt = i05Var.w().charAt(0);
                            } else if (iAd3 == 1) {
                                i05Var.n();
                            } else if (iAd3 == 2) {
                                dN = i05Var.n();
                            } else if (iAd3 == 3) {
                                strW7 = i05Var.w();
                            } else if (iAd3 == 4) {
                                strW8 = i05Var.w();
                            } else if (iAd3 != 5) {
                                i05Var.af();
                                i05Var.ah();
                            } else {
                                i05Var.b();
                                while (i05Var.k()) {
                                    if (i05Var.ad(ah3.b) != 0) {
                                        i05Var.af();
                                        i05Var.ah();
                                    } else {
                                        i05Var.a();
                                        while (i05Var.k()) {
                                            arrayList4.add((fp8) qe1.a(i05Var, zj5Var));
                                        }
                                        i05Var.d();
                                    }
                                }
                                i05Var.h();
                            }
                        }
                        i05Var.h();
                        zg3 zg3Var = new zg3(arrayList4, cCharAt, dN, strW7, strW8);
                        wy8Var.e(zg3Var.hashCode(), zg3Var);
                    }
                    i05Var.d();
                    f3 = f4;
                    fC = f7;
                    fN2 = f2;
                    fN3 = f3;
                    fN = f;
                    break;
                case 10:
                    i05Var.a();
                    while (i05Var.k()) {
                        i05Var.b();
                        String strW9 = null;
                        float fN4 = 0.0f;
                        float fN5 = 0.0f;
                        while (i05Var.k()) {
                            int iAd4 = i05Var.ad(d);
                            if (iAd4 != 0) {
                                f5 = fN;
                                if (iAd4 == 1) {
                                    f6 = fN2;
                                    fN3 = fN3;
                                    fN4 = (float) i05Var.n();
                                } else if (iAd4 != 2) {
                                    i05Var.af();
                                    i05Var.ah();
                                } else {
                                    f6 = fN2;
                                    fN3 = fN3;
                                    fN5 = (float) i05Var.n();
                                }
                                fN = f5;
                                fN2 = f6;
                            } else {
                                f5 = fN;
                                strW9 = i05Var.w();
                            }
                            fN = f5;
                        }
                        i05Var.h();
                        arrayList2.add(new gp5(strW9, fN4, fN5));
                        fN3 = fN3;
                        fN2 = fN2;
                        fN = fN;
                    }
                    f = fN;
                    f2 = fN2;
                    f4 = fN3;
                    i05Var.d();
                    f3 = f4;
                    fC = f7;
                    fN2 = f2;
                    fN3 = f3;
                    fN = f;
                    break;
                default:
                    i05Var.af();
                    i05Var.ah();
                    f = fN;
                    f2 = fN2;
                    f3 = fN3;
                    fC = f7;
                    fN2 = f2;
                    fN3 = f3;
                    fN = f;
                    break;
            }
        }
        float f10 = fC;
        float f11 = fN;
        Rect rect = new Rect(0, 0, (int) (iN * f10), (int) (iN2 * f10));
        float fC2 = sda.c();
        zj5Var.k = rect;
        zj5Var.l = fN2;
        zj5Var.m = fN3;
        zj5Var.n = f11;
        zj5Var.j = arrayList;
        zj5Var.i = hj5Var;
        zj5Var.c = map;
        zj5Var.d = map2;
        zj5Var.e = fC2;
        zj5Var.h = wy8Var;
        zj5Var.f = map3;
        zj5Var.g = arrayList2;
        return zj5Var;
    }
}
