WeChat.apk(点击下载) / j.java


package d6;

import android.graphics.Matrix;
import android.util.Xml;
import com.google.android.gms.dynamite.ProviderConstants;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.tencent.kinda.framework.widget.tools.ConstantsKinda;
import com.tencent.liteav.TXLiteAVCode;
import com.tencent.map.geolocation.sapp.TencentLocation;
import com.tencent.matrix.battery.accumulate.persist.FlattProperty;
import com.tencent.mm.plugin.mmsight.segment.FFmpegMetadataRetriever;
import com.tencent.mm.sdk.platformtools.Util;
import com.tencent.thumbplayer.composition.TPMediaCompositionHelper;
import com.tencent.thumbplayer.tmediacodec.util.MimeTypes;
import com.tencent.thumbplayer.tplayer.plugins.report.TPReportKeys;
import com.tencent.xweb.updater.IXWebBroadcastListener;
import d6.b;
import d6.e;
import d6.g;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParserFactory;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.XMLReader;
import org.xml.sax.ext.DefaultHandler2;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class j {

    /* renamed from: a  reason: collision with root package name */
    public g f198523a = null;

    /* renamed from: b  reason: collision with root package name */
    public g.j0 f198524b = null;

    /* renamed from: c  reason: collision with root package name */
    public boolean f198525c = false;

    /* renamed from: d  reason: collision with root package name */
    public int f198526d;

    /* renamed from: e  reason: collision with root package name */
    public boolean f198527e = false;

    /* renamed from: f  reason: collision with root package name */
    public h f198528f = null;

    /* renamed from: g  reason: collision with root package name */
    public StringBuilder f198529g = null;

    /* renamed from: h  reason: collision with root package name */
    public boolean f198530h = false;

    /* renamed from: i  reason: collision with root package name */
    public StringBuilder f198531i = null;

    public static class b {

        /* renamed from: a  reason: collision with root package name */
        public static final Map<String, e.a> f198532a;

        static {
            HashMap hashMap = new HashMap(10);
            f198532a = hashMap;
            hashMap.put("none", e.a.none);
            hashMap.put("xMinYMin", e.a.xMinYMin);
            hashMap.put("xMidYMin", e.a.xMidYMin);
            hashMap.put("xMaxYMin", e.a.xMaxYMin);
            hashMap.put("xMinYMid", e.a.xMinYMid);
            hashMap.put("xMidYMid", e.a.xMidYMid);
            hashMap.put("xMaxYMid", e.a.xMaxYMid);
            hashMap.put("xMinYMax", e.a.xMinYMax);
            hashMap.put("xMidYMax", e.a.xMidYMax);
            hashMap.put("xMaxYMax", e.a.xMaxYMax);
        }
    }

    public static class c {

        /* renamed from: a  reason: collision with root package name */
        public static final Map<String, Integer> f198533a;

        static {
            HashMap hashMap = new HashMap(47);
            f198533a = hashMap;
            hashMap.put("aliceblue", -984833);
            hashMap.put("antiquewhite", -332841);
            hashMap.put("aqua", -16711681);
            hashMap.put("aquamarine", -8388652);
            hashMap.put("azure", -983041);
            hashMap.put("beige", -657956);
            hashMap.put("bisque", -6972);
            hashMap.put("black", -16777216);
            hashMap.put("blanchedalmond", -5171);
            hashMap.put("blue", -16776961);
            hashMap.put("blueviolet", -7722014);
            hashMap.put("brown", -5952982);
            hashMap.put("burlywood", -2180985);
            hashMap.put("cadetblue", -10510688);
            hashMap.put("chartreuse", -8388864);
            hashMap.put("chocolate", -2987746);
            hashMap.put("coral", -32944);
            hashMap.put("cornflowerblue", -10185235);
            hashMap.put("cornsilk", -1828);
            hashMap.put("crimson", -2354116);
            hashMap.put("cyan", -16711681);
            hashMap.put("darkblue", -16777077);
            hashMap.put("darkcyan", -16741493);
            hashMap.put("darkgoldenrod", -4684277);
            hashMap.put("darkgray", -5658199);
            hashMap.put("darkgreen", -16751616);
            hashMap.put("darkgrey", -5658199);
            hashMap.put("darkkhaki", -4343957);
            hashMap.put("darkmagenta", -7667573);
            hashMap.put("darkolivegreen", -11179217);
            hashMap.put("darkorange", -29696);
            hashMap.put("darkorchid", -6737204);
            hashMap.put("darkred", -7667712);
            hashMap.put("darksalmon", -1468806);
            hashMap.put("darkseagreen", -7357297);
            hashMap.put("darkslateblue", -12042869);
            hashMap.put("darkslategray", -13676721);
            hashMap.put("darkslategrey", -13676721);
            hashMap.put("darkturquoise", -16724271);
            hashMap.put("darkviolet", -7077677);
            hashMap.put("deeppink", -60269);
            hashMap.put("deepskyblue", -16728065);
            hashMap.put("dimgray", -9868951);
            hashMap.put("dimgrey", -9868951);
            hashMap.put("dodgerblue", -14774017);
            hashMap.put("firebrick", -5103070);
            hashMap.put("floralwhite", -1296);
            hashMap.put("forestgreen", -14513374);
            hashMap.put("fuchsia", -65281);
            hashMap.put("gainsboro", -2302756);
            hashMap.put("ghostwhite", -460545);
            hashMap.put("gold", -10496);
            hashMap.put("goldenrod", -2448096);
            hashMap.put("gray", -8355712);
            hashMap.put("green", -16744448);
            hashMap.put("greenyellow", -5374161);
            hashMap.put("grey", -8355712);
            hashMap.put("honeydew", -983056);
            hashMap.put("hotpink", -38476);
            hashMap.put("indianred", -3318692);
            hashMap.put("indigo", -11861886);
            hashMap.put("ivory", -16);
            hashMap.put("khaki", -989556);
            hashMap.put("lavender", -1644806);
            hashMap.put("lavenderblush", -3851);
            hashMap.put("lawngreen", -8586240);
            hashMap.put("lemonchiffon", Integer.valueOf((int) TXLiteAVCode.ERR_AUDIO_PLUGIN_INSTALL_NOT_AUTHORIZED));
            hashMap.put("lightblue", -5383962);
            hashMap.put("lightcoral", -1015680);
            hashMap.put("lightcyan", -2031617);
            hashMap.put("lightgoldenrodyellow", -329006);
            hashMap.put("lightgray", -2894893);
            hashMap.put("lightgreen", -7278960);
            hashMap.put("lightgrey", -2894893);
            hashMap.put("lightpink", -18751);
            hashMap.put("lightsalmon", -24454);
            hashMap.put("lightseagreen", -14634326);
            hashMap.put("lightskyblue", -7876870);
            hashMap.put("lightslategray", -8943463);
            hashMap.put("lightslategrey", -8943463);
            hashMap.put("lightsteelblue", -5192482);
            hashMap.put("lightyellow", -32);
            hashMap.put("lime", -16711936);
            hashMap.put("limegreen", -13447886);
            hashMap.put("linen", -331546);
            hashMap.put("magenta", -65281);
            hashMap.put("maroon", -8388608);
            hashMap.put("mediumaquamarine", -10039894);
            hashMap.put("mediumblue", -16777011);
            hashMap.put("mediumorchid", -4565549);
            hashMap.put("mediumpurple", -7114533);
            hashMap.put("mediumseagreen", -12799119);
            hashMap.put("mediumslateblue", -8689426);
            hashMap.put("mediumspringgreen", -16713062);
            hashMap.put("mediumturquoise", -12004916);
            hashMap.put("mediumvioletred", -3730043);
            hashMap.put("midnightblue", -15132304);
            hashMap.put("mintcream", -655366);
            hashMap.put("mistyrose", -6943);
            hashMap.put("moccasin", -6987);
            hashMap.put("navajowhite", -8531);
            hashMap.put("navy", -16777088);
            hashMap.put("oldlace", -133658);
            hashMap.put("olive", -8355840);
            hashMap.put("olivedrab", -9728477);
            hashMap.put("orange", -23296);
            hashMap.put("orangered", -47872);
            hashMap.put("orchid", -2461482);
            hashMap.put("palegoldenrod", -1120086);
            hashMap.put("palegreen", -6751336);
            hashMap.put("paleturquoise", -5247250);
            hashMap.put("palevioletred", -2396013);
            hashMap.put("papayawhip", -4139);
            hashMap.put("peachpuff", -9543);
            hashMap.put("peru", -3308225);
            hashMap.put("pink", -16181);
            hashMap.put("plum", -2252579);
            hashMap.put("powderblue", -5185306);
            hashMap.put("purple", -8388480);
            hashMap.put("rebeccapurple", -10079335);
            hashMap.put("red", -65536);
            hashMap.put("rosybrown", -4419697);
            hashMap.put("royalblue", -12490271);
            hashMap.put("saddlebrown", -7650029);
            hashMap.put("salmon", -360334);
            hashMap.put("sandybrown", -744352);
            hashMap.put("seagreen", -13726889);
            hashMap.put("seashell", -2578);
            hashMap.put("sienna", -6270419);
            hashMap.put("silver", -4144960);
            hashMap.put("skyblue", -7876885);
            hashMap.put("slateblue", -9807155);
            hashMap.put("slategray", -9404272);
            hashMap.put("slategrey", -9404272);
            hashMap.put("snow", -1286);
            hashMap.put("springgreen", -16711809);
            hashMap.put("steelblue", -12156236);
            hashMap.put("tan", -2968436);
            hashMap.put("teal", -16744320);
            hashMap.put("thistle", -2572328);
            hashMap.put("tomato", -40121);
            hashMap.put("turquoise", -12525360);
            hashMap.put("violet", -1146130);
            hashMap.put("wheat", -663885);
            hashMap.put("white", -1);
            hashMap.put("whitesmoke", -657931);
            hashMap.put("yellow", -256);
            hashMap.put("yellowgreen", -6632142);
            hashMap.put(ConstantsKinda.INTENT_LITEAPP_TRANSPARENT, 0);
        }
    }

    public static class d {

        /* renamed from: a  reason: collision with root package name */
        public static final Map<String, g.p> f198534a;

        static {
            HashMap hashMap = new HashMap(9);
            f198534a = hashMap;
            g.d1 d1Var = g.d1.f198315g;
            hashMap.put("xx-small", new g.p(0.694f, d1Var));
            hashMap.put("x-small", new g.p(0.833f, d1Var));
            hashMap.put("small", new g.p(10.0f, d1Var));
            hashMap.put(FirebaseAnalytics.b.MEDIUM, new g.p(12.0f, d1Var));
            hashMap.put("large", new g.p(14.4f, d1Var));
            hashMap.put("x-large", new g.p(17.3f, d1Var));
            hashMap.put("xx-large", new g.p(20.7f, d1Var));
            g.d1 d1Var2 = g.d1.f198316h;
            hashMap.put("smaller", new g.p(83.33f, d1Var2));
            hashMap.put("larger", new g.p(120.0f, d1Var2));
        }
    }

    public static class e {

        /* renamed from: a  reason: collision with root package name */
        public static final Map<String, Integer> f198535a;

        static {
            HashMap hashMap = new HashMap(13);
            f198535a = hashMap;
            hashMap.put("normal", 400);
            hashMap.put("bold", 700);
            hashMap.put("bolder", 1);
            hashMap.put("lighter", -1);
            hashMap.put("100", 100);
            hashMap.put("200", 200);
            hashMap.put("300", 300);
            hashMap.put("400", 400);
            hashMap.put("500", 500);
            hashMap.put("600", 600);
            hashMap.put("700", 700);
            hashMap.put("800", 800);
            hashMap.put("900", 900);
        }
    }

    public class f extends DefaultHandler2 {
        public f(a aVar) {
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void characters(char[] cArr, int i15, int i16) {
            j.this.K(new String(cArr, i15, i16));
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void endDocument() {
            j.this.getClass();
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void endElement(String str, String str2, String str3) {
            j.this.c(str, str2, str3);
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void processingInstruction(String str, String str2) {
            j.this.B(new i(str2));
            j.this.getClass();
            str.equals("xml-stylesheet");
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void startDocument() {
            j jVar = j.this;
            jVar.getClass();
            jVar.f198523a = new g();
        }

        @Override // org.xml.sax.helpers.DefaultHandler, org.xml.sax.ContentHandler
        public void startElement(String str, String str2, String str3, Attributes attributes) {
            j.this.I(str, str2, str3, attributes);
        }
    }

    /* JADX INFO: Failed to restore enum class, 'enum' modifier removed */
    public static final class g extends Enum<g> {

        /* renamed from: d  reason: collision with root package name */
        public static final g f198537d;

        /* renamed from: e  reason: collision with root package name */
        public static final g f198538e;

        /* renamed from: f  reason: collision with root package name */
        public static final g f198539f;

        /* renamed from: g  reason: collision with root package name */
        public static final g f198540g;

        /* renamed from: h  reason: collision with root package name */
        public static final Map<String, g> f198541h = new HashMap();

        /* renamed from: i  reason: collision with root package name */
        public static final /* synthetic */ g[] f198542i;

        static {
            g gVar = new g("CLASS", 0);
            f198537d = gVar;
            g gVar2 = new g(TPReportKeys.VodExKeys.VOD_EX_CLIP_COUNT, 1);
            g gVar3 = new g(TPMediaCompositionHelper.XML_TAG_CLIP_PATH, 2);
            g gVar4 = new g("clipPathUnits", 3);
            g gVar5 = new g("clip_rule", 4);
            g gVar6 = new g("color", 5);
            g gVar7 = new g("cx", 6);
            g gVar8 = new g("cy", 7);
            g gVar9 = new g(TencentLocation.EXTRA_DIRECTION, 8);
            g gVar10 = new g("dx", 9);
            g gVar11 = new g("dy", 10);
            g gVar12 = new g("fx", 11);
            g gVar13 = new g("fy", 12);
            g gVar14 = new g("d", 13);
            g gVar15 = new g("display", 14);
            g gVar16 = new g("fill", 15);
            g gVar17 = new g("fill_rule", 16);
            g gVar18 = new g("fill_opacity", 17);
            g gVar19 = new g("font", 18);
            g gVar20 = new g("font_family", 19);
            g gVar21 = new g("font_size", 20);
            g gVar22 = new g("font_weight", 21);
            g gVar23 = new g("font_style", 22);
            g gVar24 = new g("gradientTransform", 23);
            g gVar25 = new g("gradientUnits", 24);
            g gVar26 = new g("height", 25);
            g gVar27 = new g("href", 26);
            g gVar28 = new g("image_rendering", 27);
            g gVar29 = new g("marker", 28);
            g gVar30 = new g("marker_start", 29);
            g gVar31 = new g("marker_mid", 30);
            g gVar32 = new g("marker_end", 31);
            g gVar33 = new g("markerHeight", 32);
            g gVar34 = new g("markerUnits", 33);
            g gVar35 = new g("markerWidth", 34);
            g gVar36 = new g("mask", 35);
            g gVar37 = new g("maskContentUnits", 36);
            g gVar38 = new g("maskUnits", 37);
            g gVar39 = new g("media", 38);
            g gVar40 = new g("offset", 39);
            g gVar41 = new g("opacity", 40);
            g gVar42 = new g("orient", 41);
            g gVar43 = new g("overflow", 42);
            g gVar44 = new g("pathLength", 43);
            g gVar45 = new g("patternContentUnits", 44);
            g gVar46 = new g("patternTransform", 45);
            g gVar47 = new g("patternUnits", 46);
            g gVar48 = new g("points", 47);
            f198538e = gVar48;
            g gVar49 = new g("preserveAspectRatio", 48);
            g gVar50 = new g("r", 49);
            g gVar51 = new g("refX", 50);
            g gVar52 = new g("refY", 51);
            g gVar53 = new g("requiredFeatures", 52);
            g gVar54 = new g("requiredExtensions", 53);
            g gVar55 = new g("requiredFormats", 54);
            g gVar56 = new g("requiredFonts", 55);
            g gVar57 = new g("rx", 56);
            g gVar58 = new g("ry", 57);
            g gVar59 = new g("solid_color", 58);
            g gVar60 = new g("solid_opacity", 59);
            g gVar61 = new g("spreadMethod", 60);
            g gVar62 = new g("startOffset", 61);
            g gVar63 = new g("stop_color", 62);
            g gVar64 = new g("stop_opacity", 63);
            g gVar65 = new g("stroke", 64);
            g gVar66 = new g("stroke_dasharray", 65);
            g gVar67 = new g("stroke_dashoffset", 66);
            g gVar68 = new g("stroke_linecap", 67);
            g gVar69 = new g("stroke_linejoin", 68);
            g gVar70 = new g("stroke_miterlimit", 69);
            g gVar71 = new g("stroke_opacity", 70);
            g gVar72 = new g("stroke_width", 71);
            g gVar73 = new g("style", 72);
            g gVar74 = new g("systemLanguage", 73);
            g gVar75 = new g("text_anchor", 74);
            g gVar76 = new g("text_decoration", 75);
            g gVar77 = new g("transform", 76);
            f198539f = gVar77;
            g gVar78 = new g("type", 77);
            g gVar79 = new g("vector_effect", 78);
            g gVar80 = new g(ProviderConstants.API_COLNAME_FEATURE_VERSION, 79);
            g gVar81 = new g("viewBox", 80);
            g gVar82 = new g("width", 81);
            g gVar83 = new g("x", 82);
            g gVar84 = new g("y", 83);
            g gVar85 = new g("x1", 84);
            g gVar86 = new g("y1", 85);
            g gVar87 = new g("x2", 86);
            g gVar88 = new g("y2", 87);
            g gVar89 = new g("viewport_fill", 88);
            g gVar90 = new g("viewport_fill_opacity", 89);
            g gVar91 = new g("visibility", 90);
            g gVar92 = new g("UNSUPPORTED", 91);
            f198540g = gVar92;
            f198542i = new g[]{gVar, gVar2, gVar3, gVar4, gVar5, gVar6, gVar7, gVar8, gVar9, gVar10, gVar11, gVar12, gVar13, gVar14, gVar15, gVar16, gVar17, gVar18, gVar19, gVar20, gVar21, gVar22, gVar23, gVar24, gVar25, gVar26, gVar27, gVar28, gVar29, gVar30, gVar31, gVar32, gVar33, gVar34, gVar35, gVar36, gVar37, gVar38, gVar39, gVar40, gVar41, gVar42, gVar43, gVar44, gVar45, gVar46, gVar47, gVar48, gVar49, gVar50, gVar51, gVar52, gVar53, gVar54, gVar55, gVar56, gVar57, gVar58, gVar59, gVar60, gVar61, gVar62, gVar63, gVar64, gVar65, gVar66, gVar67, gVar68, gVar69, gVar70, gVar71, gVar72, gVar73, gVar74, gVar75, gVar76, gVar77, gVar78, gVar79, gVar80, gVar81, gVar82, gVar83, gVar84, gVar85, gVar86, gVar87, gVar88, gVar89, gVar90, gVar91, gVar92};
            g[] values = values();
            for (g gVar93 : values) {
                if (gVar93 == f198537d) {
                    ((HashMap) f198541h).put("class", gVar93);
                } else if (gVar93 != f198540g) {
                    ((HashMap) f198541h).put(gVar93.name().replace('_', '-'), gVar93);
                }
            }
        }

        public g(String str, int i15) {
        }

        public static g a(String str) {
            g gVar = (g) ((HashMap) f198541h).get(str);
            if (gVar != null) {
                return gVar;
            }
            return f198540g;
        }

        public static g valueOf(String str) {
            return (g) Enum.valueOf(g.class, str);
        }

        public static g[] values() {
            return (g[]) f198542i.clone();
        }
    }

    /* JADX INFO: Failed to restore enum class, 'enum' modifier removed */
    public static final class h extends Enum<h> {

        /* renamed from: d  reason: collision with root package name */
        public static final h f198543d;

        /* renamed from: e  reason: collision with root package name */
        public static final h f198544e;

        /* renamed from: f  reason: collision with root package name */
        public static final h f198545f;

        /* renamed from: g  reason: collision with root package name */
        public static final h f198546g;

        /* renamed from: h  reason: collision with root package name */
        public static final Map<String, h> f198547h = new HashMap();

        /* renamed from: i  reason: collision with root package name */
        public static final /* synthetic */ h[] f198548i;

        static {
            h hVar = new h("svg", 0);
            h hVar2 = new h("a", 1);
            h hVar3 = new h("circle", 2);
            h hVar4 = new h("clipPath", 3);
            h hVar5 = new h("defs", 4);
            h hVar6 = new h("desc", 5);
            f198543d = hVar6;
            h hVar7 = new h("ellipse", 6);
            h hVar8 = new h("g", 7);
            h hVar9 = new h("image", 8);
            h hVar10 = new h("line", 9);
            h hVar11 = new h("linearGradient", 10);
            h hVar12 = new h("marker", 11);
            h hVar13 = new h("mask", 12);
            h hVar14 = new h(ConstantsKinda.INTENT_LITEAPP_PATH, 13);
            h hVar15 = new h("pattern", 14);
            h hVar16 = new h("polygon", 15);
            h hVar17 = new h("polyline", 16);
            h hVar18 = new h("radialGradient", 17);
            h hVar19 = new h("rect", 18);
            h hVar20 = new h("solidColor", 19);
            h hVar21 = new h("stop", 20);
            h hVar22 = new h("style", 21);
            h hVar23 = new h("SWITCH", 22);
            f198544e = hVar23;
            h hVar24 = new h("symbol", 23);
            h hVar25 = new h(MimeTypes.BASE_TYPE_TEXT, 24);
            h hVar26 = new h("textPath", 25);
            h hVar27 = new h(FFmpegMetadataRetriever.METADATA_KEY_TITLE, 26);
            f198545f = hVar27;
            h hVar28 = new h("tref", 27);
            h hVar29 = new h("tspan", 28);
            h hVar30 = new h("use", 29);
            h hVar31 = new h("view", 30);
            h hVar32 = new h("UNSUPPORTED", 31);
            f198546g = hVar32;
            f198548i = new h[]{hVar, hVar2, hVar3, hVar4, hVar5, hVar6, hVar7, hVar8, hVar9, hVar10, hVar11, hVar12, hVar13, hVar14, hVar15, hVar16, hVar17, hVar18, hVar19, hVar20, hVar21, hVar22, hVar23, hVar24, hVar25, hVar26, hVar27, hVar28, hVar29, hVar30, hVar31, hVar32};
            h[] values = values();
            for (h hVar33 : values) {
                if (hVar33 == f198544e) {
                    ((HashMap) f198547h).put(TPReportKeys.LiveExKeys.LIVE_EX_DEFINATION_SWICH, hVar33);
                } else if (hVar33 != f198546g) {
                    ((HashMap) f198547h).put(hVar33.name(), hVar33);
                }
            }
        }

        public h(String str, int i15) {
        }

        public static h valueOf(String str) {
            return (h) Enum.valueOf(h.class, str);
        }

        public static h[] values() {
            return (h[]) f198548i.clone();
        }
    }

    public static class i {

        /* renamed from: a  reason: collision with root package name */
        public String f198549a;

        /* renamed from: b  reason: collision with root package name */
        public int f198550b = 0;

        /* renamed from: c  reason: collision with root package name */
        public int f198551c = 0;

        /* renamed from: d  reason: collision with root package name */
        public d f198552d = new d();

        public i(String str) {
            String trim = str.trim();
            this.f198549a = trim;
            this.f198551c = trim.length();
        }

        public int a() {
            int i15 = this.f198550b;
            int i16 = this.f198551c;
            if (i15 == i16) {
                return -1;
            }
            int i17 = i15 + 1;
            this.f198550b = i17;
            if (i17 < i16) {
                return this.f198549a.charAt(i17);
            }
            return -1;
        }

        public Boolean b(Object obj) {
            if (obj == null) {
                return null;
            }
            p();
            int i15 = this.f198550b;
            if (i15 == this.f198551c) {
                return null;
            }
            char charAt = this.f198549a.charAt(i15);
            if (charAt != '0' && charAt != '1') {
                return null;
            }
            boolean z15 = true;
            this.f198550b++;
            if (charAt != '1') {
                z15 = false;
            }
            return Boolean.valueOf(z15);
        }

        public float c(float f15) {
            if (Float.isNaN(f15)) {
                return Float.NaN;
            }
            p();
            return i();
        }

        public boolean d(char c15) {
            boolean z15;
            int i15 = this.f198550b;
            if (i15 >= this.f198551c || this.f198549a.charAt(i15) != c15) {
                z15 = false;
            } else {
                z15 = true;
            }
            if (z15) {
                this.f198550b++;
            }
            return z15;
        }

        public boolean e(String str) {
            boolean z15;
            int length = str.length();
            int i15 = this.f198550b;
            if (i15 > this.f198551c - length || !this.f198549a.substring(i15, i15 + length).equals(str)) {
                z15 = false;
            } else {
                z15 = true;
            }
            if (z15) {
                this.f198550b += length;
            }
            return z15;
        }

        public boolean f() {
            return this.f198550b == this.f198551c;
        }

        public boolean g(int i15) {
            return i15 == 32 || i15 == 10 || i15 == 13 || i15 == 9;
        }

        public Integer h() {
            int i15 = this.f198550b;
            if (i15 == this.f198551c) {
                return null;
            }
            String str = this.f198549a;
            this.f198550b = i15 + 1;
            return Integer.valueOf(str.charAt(i15));
        }

        public float i() {
            float a15 = this.f198552d.a(this.f198549a, this.f198550b, this.f198551c);
            if (!Float.isNaN(a15)) {
                this.f198550b = this.f198552d.f198262a;
            }
            return a15;
        }

        public g.p j() {
            float i15 = i();
            if (Float.isNaN(i15)) {
                return null;
            }
            g.d1 n15 = n();
            if (n15 == null) {
                return new g.p(i15, g.d1.f198312d);
            }
            return new g.p(i15, n15);
        }

        public String k() {
            if (f()) {
                return null;
            }
            int i15 = this.f198550b;
            char charAt = this.f198549a.charAt(i15);
            if (charAt != '\'' && charAt != '\"') {
                return null;
            }
            int a15 = a();
            while (a15 != -1 && a15 != charAt) {
                a15 = a();
            }
            if (a15 == -1) {
                this.f198550b = i15;
                return null;
            }
            int i16 = this.f198550b + 1;
            this.f198550b = i16;
            return this.f198549a.substring(i15 + 1, i16 - 1);
        }

        public String l() {
            return m(' ', false);
        }

        public String m(char c15, boolean z15) {
            if (f()) {
                return null;
            }
            char charAt = this.f198549a.charAt(this.f198550b);
            if ((!z15 && g(charAt)) || charAt == c15) {
                return null;
            }
            int i15 = this.f198550b;
            int a15 = a();
            while (a15 != -1 && a15 != c15 && (z15 || !g(a15))) {
                a15 = a();
            }
            return this.f198549a.substring(i15, this.f198550b);
        }

        public g.d1 n() {
            if (f()) {
                return null;
            }
            if (this.f198549a.charAt(this.f198550b) == '%') {
                this.f198550b++;
                return g.d1.f198316h;
            }
            int i15 = this.f198550b;
            if (i15 > this.f198551c - 2) {
                return null;
            }
            try {
                g.d1 valueOf = g.d1.valueOf(this.f198549a.substring(i15, i15 + 2).toLowerCase(Locale.US));
                this.f198550b += 2;
                return valueOf;
            } catch (IllegalArgumentException unused) {
                return null;
            }
        }

        public float o() {
            p();
            float a15 = this.f198552d.a(this.f198549a, this.f198550b, this.f198551c);
            if (!Float.isNaN(a15)) {
                this.f198550b = this.f198552d.f198262a;
            }
            return a15;
        }

        public boolean p() {
            q();
            int i15 = this.f198550b;
            if (i15 == this.f198551c || this.f198549a.charAt(i15) != ',') {
                return false;
            }
            this.f198550b++;
            q();
            return true;
        }

        public void q() {
            while (true) {
                int i15 = this.f198550b;
                if (i15 < this.f198551c && g(this.f198549a.charAt(i15))) {
                    this.f198550b++;
                } else {
                    return;
                }
            }
        }
    }

    /* renamed from: d6.j$j  reason: collision with other inner class name */
    public class C2119j implements Attributes {

        /* renamed from: a  reason: collision with root package name */
        public XmlPullParser f198553a;

        public C2119j(j jVar, XmlPullParser xmlPullParser) {
            this.f198553a = xmlPullParser;
        }

        public int getIndex(String str) {
            return -1;
        }

        public int getIndex(String str, String str2) {
            return -1;
        }

        public int getLength() {
            return this.f198553a.getAttributeCount();
        }

        public String getLocalName(int i15) {
            return this.f198553a.getAttributeName(i15);
        }

        public String getQName(int i15) {
            String attributeName = this.f198553a.getAttributeName(i15);
            if (this.f198553a.getAttributePrefix(i15) == null) {
                return attributeName;
            }
            return this.f198553a.getAttributePrefix(i15) + ':' + attributeName;
        }

        @Override // org.xml.sax.Attributes
        public String getType(int i15) {
            return null;
        }

        @Override // org.xml.sax.Attributes
        public String getType(String str) {
            return null;
        }

        public String getType(String str, String str2) {
            return null;
        }

        public String getURI(int i15) {
            return this.f198553a.getAttributeNamespace(i15);
        }

        @Override // org.xml.sax.Attributes
        public String getValue(int i15) {
            return this.f198553a.getAttributeValue(i15);
        }

        @Override // org.xml.sax.Attributes
        public String getValue(String str) {
            return null;
        }

        public String getValue(String str, String str2) {
            return null;
        }
    }

    public static void A(g.p0 p0Var, String str) {
        i iVar = new i(str);
        iVar.q();
        String l15 = iVar.l();
        if ("defer".equals(l15)) {
            iVar.q();
            l15 = iVar.l();
        }
        e.a aVar = (e.a) ((HashMap) b.f198532a).get(l15);
        e.b bVar = null;
        iVar.q();
        if (!iVar.f()) {
            String l16 = iVar.l();
            l16.getClass();
            if (l16.equals("meet")) {
                bVar = e.b.meet;
            } else if (l16.equals("slice")) {
                bVar = e.b.slice;
            } else {
                throw new i("Invalid preserveAspectRatio definition: " + str);
            }
        }
        p0Var.f198432o = new e(aVar, bVar);
    }

    /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
    /* JADX WARNING: Code restructure failed: missing block: B:129:0x0264, code lost:
        if (r19.equals("auto") == false) goto L_0x0252;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:232:0x0475, code lost:
        if (r19.equals("underline") == false) goto L_0x044d;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:252:0x04bd, code lost:
        if (r19.equals("end") == false) goto L_0x04a9;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:291:0x055f, code lost:
        if (r19.equals("scroll") == false) goto L_0x0544;
     */
    public static void G(g.e0 e0Var, String str, String str2) {
        g.p pVar;
        int i15;
        g.p j15;
        g.e0.a aVar = g.e0.a.EvenOdd;
        g.e0.a aVar2 = g.e0.a.NonZero;
        if (str2.length() != 0 && !str2.equals("inherit")) {
            int ordinal = g.a(str).ordinal();
            g.c cVar = null;
            g.e0.d dVar = null;
            g.e0.c cVar2 = null;
            r8 = null;
            r8 = null;
            r8 = null;
            r8 = null;
            r8 = null;
            g.p[] pVarArr = null;
            g.e0.e eVar = null;
            g.p pVar2 = null;
            String str3 = null;
            g.e0.EnumC2116g gVar = null;
            g.e0.f fVar = null;
            g.e0.i iVar = null;
            Boolean bool = null;
            g.e0.h hVar = null;
            cVar = null;
            cVar = null;
            char c15 = 1;
            if (ordinal == 1) {
                if (!"auto".equals(str2) && str2.startsWith("rect(")) {
                    i iVar2 = new i(str2.substring(5));
                    iVar2.q();
                    g.p x15 = x(iVar2);
                    iVar2.p();
                    g.p x16 = x(iVar2);
                    iVar2.p();
                    g.p x17 = x(iVar2);
                    iVar2.p();
                    g.p x18 = x(iVar2);
                    iVar2.q();
                    if (iVar2.d(')') || iVar2.f()) {
                        cVar = new g.c(x15, x16, x17, x18);
                    }
                }
                e0Var.C = cVar;
                if (cVar != null) {
                    e0Var.f198319d |= 1048576;
                }
            } else if (ordinal == 2) {
                e0Var.K = u(str2, str);
                e0Var.f198319d |= 268435456;
            } else if (ordinal == 4) {
                if ("nonzero".equals(str2)) {
                    aVar = aVar2;
                } else if (!"evenodd".equals(str2)) {
                    aVar = null;
                }
                e0Var.L = aVar;
                e0Var.f198319d |= 536870912;
            } else if (ordinal == 5) {
                e0Var.f198332t = o(str2);
                e0Var.f198319d |= 4096;
            } else if (ordinal == 8) {
                if (str2.equals("ltr")) {
                    hVar = g.e0.h.LTR;
                } else if (str2.equals("rtl")) {
                    hVar = g.e0.h.RTL;
                }
                e0Var.f198338z = hVar;
                if (hVar != null) {
                    e0Var.f198319d |= 68719476736L;
                }
            } else if (ordinal == 35) {
                e0Var.M = u(str2, str);
                e0Var.f198319d |= 1073741824;
            } else if (ordinal == 40) {
                e0Var.f198331s = y(str2);
                e0Var.f198319d |= 2048;
            } else if (ordinal == 42) {
                switch (str2.hashCode()) {
                    case -1217487446:
                        if (str2.equals("hidden")) {
                            c15 = 0;
                            break;
                        }
                        c15 = 65535;
                        break;
                    case -907680051:
                        break;
                    case 3005871:
                        if (str2.equals("auto")) {
                            c15 = 2;
                            break;
                        }
                        c15 = 65535;
                        break;
                    case 466743410:
                        if (str2.equals("visible")) {
                            c15 = 3;
                            break;
                        }
                        c15 = 65535;
                        break;
                    default:
                        c15 = 65535;
                        break;
                }
                switch (c15) {
                    case 0:
                    case 1:
                        bool = Boolean.FALSE;
                        break;
                    case 2:
                    case 3:
                        bool = Boolean.TRUE;
                        break;
                }
                e0Var.B = bool;
                if (bool != null) {
                    e0Var.f198319d |= 524288;
                }
            } else if (ordinal == 78) {
                if (str2.equals("none")) {
                    iVar = g.e0.i.None;
                } else if (str2.equals("non-scaling-stroke")) {
                    iVar = g.e0.i.NonScalingStroke;
                }
                e0Var.S = iVar;
                if (iVar != null) {
                    e0Var.f198319d |= 34359738368L;
                }
            } else if (ordinal == 58) {
                if (str2.equals("currentColor")) {
                    e0Var.N = g.C2117g.f198386d;
                } else {
                    try {
                        e0Var.N = o(str2);
                    } catch (i e15) {
                        e15.getMessage();
                        return;
                    }
                }
                e0Var.f198319d |= 2147483648L;
            } else if (ordinal == 59) {
                e0Var.P = y(str2);
                e0Var.f198319d |= 4294967296L;
            } else if (ordinal == 74) {
                switch (str2.hashCode()) {
                    case -1074341483:
                        if (str2.equals("middle")) {
                            c15 = 0;
                            break;
                        }
                        c15 = 65535;
                        break;
                    case 100571:
                        break;
                    case 109757538:
                        if (str2.equals(IXWebBroadcastListener.STAGE_START)) {
                            c15 = 2;
                            break;
                        }
                        c15 = 65535;
                        break;
                    default:
                        c15 = 65535;
                        break;
                }
                switch (c15) {
                    case 0:
                        fVar = g.e0.f.Middle;
                        break;
                    case 1:
                        fVar = g.e0.f.End;
                        break;
                    case 2:
                        fVar = g.e0.f.Start;
                        break;
                }
                e0Var.A = fVar;
                if (fVar != null) {
                    e0Var.f198319d |= 262144;
                }
            } else if (ordinal != 75) {
                switch (ordinal) {
                    case 14:
                        if (str2.indexOf(124) < 0) {
                            if ("|inline|block|list-item|run-in|compact|marker|table|inline-table|table-row-group|table-header-group|table-footer-group|table-row|table-column-group|table-column|table-cell|table-caption|none|".contains('|' + str2 + '|')) {
                                e0Var.G = Boolean.valueOf(!str2.equals("none"));
                                e0Var.f198319d |= 16777216;
                                return;
                            }
                            return;
                        }
                        return;
                    case 15:
                        g.o0 z15 = z(str2);
                        e0Var.f198320e = z15;
                        if (z15 != null) {
                            e0Var.f198319d |= 1;
                            return;
                        }
                        return;
                    case 16:
                        if ("nonzero".equals(str2)) {
                            aVar = aVar2;
                        } else if (!"evenodd".equals(str2)) {
                            aVar = null;
                        }
                        e0Var.f198321f = aVar;
                        if (aVar != null) {
                            e0Var.f198319d |= 2;
                            return;
                        }
                        return;
                    case 17:
                        Float y15 = y(str2);
                        e0Var.f198322g = y15;
                        if (y15 != null) {
                            e0Var.f198319d |= 4;
                            return;
                        }
                        return;
                    case 18:
                        if ("|caption|icon|menu|message-box|small-caption|status-bar|".contains('|' + str2 + '|')) {
                            i iVar3 = new i(str2);
                            Integer num = null;
                            g.e0.b bVar = null;
                            String str4 = null;
                            while (true) {
                                String m15 = iVar3.m('/', false);
                                iVar3.q();
                                if (m15 != null) {
                                    if (num == null || bVar == null) {
                                        if (!m15.equals("normal") && ((num != null || (num = (Integer) ((HashMap) e.f198535a).get(m15)) == null) && (bVar != null || (bVar = t(m15)) == null))) {
                                            if (str4 == null && m15.equals("small-caps")) {
                                                str4 = m15;
                                            }
                                        }
                                    }
                                    try {
                                        pVar = (g.p) ((HashMap) d.f198534a).get(m15);
                                        if (pVar == null) {
                                            pVar = v(m15);
                                        }
                                    } catch (i unused) {
                                        pVar = null;
                                    }
                                    if (iVar3.d('/')) {
                                        iVar3.q();
                                        String l15 = iVar3.l();
                                        if (l15 != null) {
                                            try {
                                                v(l15);
                                            } catch (i unused2) {
                                                return;
                                            }
                                        }
                                        iVar3.q();
                                    }
                                    if (!iVar3.f()) {
                                        int i16 = iVar3.f198550b;
                                        iVar3.f198550b = iVar3.f198551c;
                                        str3 = iVar3.f198549a.substring(i16);
                                    }
                                    e0Var.f198333u = s(str3);
                                    e0Var.f198334v = pVar;
                                    if (num == null) {
                                        i15 = 400;
                                    } else {
                                        i15 = num.intValue();
                                    }
                                    e0Var.f198335w = Integer.valueOf(i15);
                                    if (bVar == null) {
                                        bVar = g.e0.b.Normal;
                                    }
                                    e0Var.f198336x = bVar;
                                    e0Var.f198319d |= 122880;
                                    return;
                                }
                                return;
                            }
                        }
                        return;
                    case 19:
                        List<String> s15 = s(str2);
                        e0Var.f198333u = s15;
                        if (s15 != null) {
                            e0Var.f198319d |= 8192;
                            return;
                        }
                        return;
                    case 20:
                        try {
                            g.p pVar3 = (g.p) ((HashMap) d.f198534a).get(str2);
                            if (pVar3 == null) {
                                pVar3 = v(str2);
                            }
                            pVar2 = pVar3;
                        } catch (i unused3) {
                        }
                        e0Var.f198334v = pVar2;
                        if (pVar2 != null) {
                            e0Var.f198319d |= 16384;
                            return;
                        }
                        return;
                    case 21:
                        Integer num2 = (Integer) ((HashMap) e.f198535a).get(str2);
                        e0Var.f198335w = num2;
                        if (num2 != null) {
                            e0Var.f198319d |= 32768;
                            return;
                        }
                        return;
                    case 22:
                        g.e0.b t15 = t(str2);
                        e0Var.f198336x = t15;
                        if (t15 != null) {
                            e0Var.f198319d |= 65536;
                            return;
                        }
                        return;
                    default:
                        switch (ordinal) {
                            case 27:
                                switch (str2.hashCode()) {
                                    case -933002398:
                                        if (str2.equals("optimizeQuality")) {
                                            c15 = 0;
                                            break;
                                        }
                                        c15 = 65535;
                                        break;
                                    case 3005871:
                                        break;
                                    case 362741610:
                                        if (str2.equals("optimizeSpeed")) {
                                            c15 = 2;
                                            break;
                                        }
                                        c15 = 65535;
                                        break;
                                    default:
                                        c15 = 65535;
                                        break;
                                }
                                switch (c15) {
                                    case 0:
                                        eVar = g.e0.e.optimizeQuality;
                                        break;
                                    case 1:
                                        eVar = g.e0.e.auto;
                                        break;
                                    case 2:
                                        eVar = g.e0.e.optimizeSpeed;
                                        break;
                                }
                                e0Var.T = eVar;
                                if (eVar != null) {
                                    e0Var.f198319d |= 137438953472L;
                                    return;
                                }
                                return;
                            case 28:
                                String u15 = u(str2, str);
                                e0Var.D = u15;
                                e0Var.E = u15;
                                e0Var.F = u15;
                                e0Var.f198319d |= 14680064;
                                return;
                            case 29:
                                e0Var.D = u(str2, str);
                                e0Var.f198319d |= 2097152;
                                return;
                            case 30:
                                e0Var.E = u(str2, str);
                                e0Var.f198319d |= 4194304;
                                return;
                            case 31:
                                e0Var.F = u(str2, str);
                                e0Var.f198319d |= 8388608;
                                return;
                            default:
                                switch (ordinal) {
                                    case 62:
                                        if (str2.equals("currentColor")) {
                                            e0Var.I = g.C2117g.f198386d;
                                        } else {
                                            try {
                                                e0Var.I = o(str2);
                                            } catch (i e16) {
                                                e16.getMessage();
                                                return;
                                            }
                                        }
                                        e0Var.f198319d |= 67108864;
                                        return;
                                    case 63:
                                        e0Var.J = y(str2);
                                        e0Var.f198319d |= 134217728;
                                        return;
                                    case 64:
                                        g.o0 z16 = z(str2);
                                        e0Var.f198323h = z16;
                                        if (z16 != null) {
                                            e0Var.f198319d |= 8;
                                            return;
                                        }
                                        return;
                                    case 65:
                                        if ("none".equals(str2)) {
                                            e0Var.f198329q = null;
                                            e0Var.f198319d |= 512;
                                            return;
                                        }
                                        i iVar4 = new i(str2);
                                        iVar4.q();
                                        if (!iVar4.f() && (j15 = iVar4.j()) != null && !j15.f()) {
                                            float f15 = j15.f198430d;
                                            ArrayList arrayList = new ArrayList();
                                            arrayList.add(j15);
                                            while (true) {
                                                if (!iVar4.f()) {
                                                    iVar4.p();
                                                    g.p j16 = iVar4.j();
                                                    if (j16 != null && !j16.f()) {
                                                        arrayList.add(j16);
                                                        f15 += j16.f198430d;
                                                    }
                                                } else if (f15 != 0.0f) {
                                                    pVarArr = (g.p[]) arrayList.toArray(new g.p[arrayList.size()]);
                                                }
                                            }
                                        }
                                        e0Var.f198329q = pVarArr;
                                        if (pVarArr != null) {
                                            e0Var.f198319d |= 512;
                                            return;
                                        }
                                        return;
                                    case 66:
                                        e0Var.f198330r = v(str2);
                                        e0Var.f198319d |= 1024;
                                        return;
                                    case 67:
                                        if ("butt".equals(str2)) {
                                            cVar2 = g.e0.c.Butt;
                                        } else if ("round".equals(str2)) {
                                            cVar2 = g.e0.c.Round;
                                        } else if ("square".equals(str2)) {
                                            cVar2 = g.e0.c.Square;
                                        }
                                        e0Var.f198326n = cVar2;
                                        if (cVar2 != null) {
                                            e0Var.f198319d |= 64;
                                            return;
                                        }
                                        return;
                                    case 68:
                                        if ("miter".equals(str2)) {
                                            dVar = g.e0.d.Miter;
                                        } else if ("round".equals(str2)) {
                                            dVar = g.e0.d.Round;
                                        } else if ("bevel".equals(str2)) {
                                            dVar = g.e0.d.Bevel;
                                        }
                                        e0Var.f198327o = dVar;
                                        if (dVar != null) {
                                            e0Var.f198319d |= 128;
                                            return;
                                        }
                                        return;
                                    case 69:
                                        e0Var.f198328p = Float.valueOf(q(str2));
                                        e0Var.f198319d |= 256;
                                        return;
                                    case 70:
                                        Float y16 = y(str2);
                                        e0Var.f198324i = y16;
                                        if (y16 != null) {
                                            e0Var.f198319d |= 16;
                                            return;
                                        }
                                        return;
                                    case 71:
                                        e0Var.f198325j = v(str2);
                                        e0Var.f198319d |= 32;
                                        return;
                                    default:
                                        switch (ordinal) {
                                            case 88:
                                                if (str2.equals("currentColor")) {
                                                    e0Var.Q = g.C2117g.f198386d;
                                                } else {
                                                    try {
                                                        e0Var.Q = o(str2);
                                                    } catch (i e17) {
                                                        e17.getMessage();
                                                        return;
                                                    }
                                                }
                                                e0Var.f198319d |= 8589934592L;
                                                return;
                                            case 89:
                                                e0Var.R = y(str2);
                                                e0Var.f198319d |= 17179869184L;
                                                return;
                                            case 90:
                                                if (str2.indexOf(124) < 0) {
                                                    if ("|visible|hidden|collapse|".contains('|' + str2 + '|')) {
                                                        e0Var.H = Boolean.valueOf(str2.equals("visible"));
                                                        e0Var.f198319d |= 33554432;
                                                        return;
                                                    }
                                                    return;
                                                }
                                                return;
                                            default:
                                                return;
                                        }
                                }
                        }
                }
            } else {
                switch (str2.hashCode()) {
                    case -1171789332:
                        if (str2.equals("line-through")) {
                            c15 = 0;
                            break;
                        }
                        c15 = 65535;
                        break;
                    case -1026963764:
                        break;
                    case 3387192:
                        if (str2.equals("none")) {
                            c15 = 2;
                            break;
                        }
                        c15 = 65535;
                        break;
                    case 93826908:
                        if (str2.equals("blink")) {
                            c15 = 3;
                            break;
                        }
                        c15 = 65535;
                        break;
                    case 529818312:
                        if (str2.equals("overline")) {
                            c15 = 4;
                            break;
                        }
                        c15 = 65535;
                        break;
                    default:
                        c15 = 65535;
                        break;
                }
                switch (c15) {
                    case 0:
                        gVar = g.e0.EnumC2116g.LineThrough;
                        break;
                    case 1:
                        gVar = g.e0.EnumC2116g.Underline;
                        break;
                    case 2:
                        gVar = g.e0.EnumC2116g.None;
                        break;
                    case 3:
                        gVar = g.e0.EnumC2116g.Blink;
                        break;
                    case 4:
                        gVar = g.e0.EnumC2116g.Overline;
                        break;
                }
                e0Var.f198337y = gVar;
                if (gVar != null) {
                    e0Var.f198319d |= 131072;
                }
            }
        }
    }

    public static int b(float f15) {
        if (f15 < 0.0f) {
            return 0;
        }
        if (f15 > 255.0f) {
            return 255;
        }
        return Math.round(f15);
    }

    public static int d(float f15, float f16, float f17) {
        float f18;
        float f19 = 0.0f;
        int i15 = (f15 > 0.0f ? 1 : (f15 == 0.0f ? 0 : -1));
        float f25 = f15 % 360.0f;
        if (i15 < 0) {
            f25 += 360.0f;
        }
        float f26 = f25 / 60.0f;
        float f27 = f16 / 100.0f;
        float f28 = f17 / 100.0f;
        if (f27 < 0.0f) {
            f27 = 0.0f;
        } else if (f27 > 1.0f) {
            f27 = 1.0f;
        }
        if (f28 >= 0.0f) {
            if (f28 > 1.0f) {
                f19 = 1.0f;
            } else {
                f19 = f28;
            }
        }
        if (f19 <= 0.5f) {
            f18 = (f27 + 1.0f) * f19;
        } else {
            f18 = (f19 + f27) - (f27 * f19);
        }
        float f29 = (f19 * 2.0f) - f18;
        return b(e(f29, f18, f26 - 2.0f) * 256.0f) | (b(e(f29, f18, f26 + 2.0f) * 256.0f) << 16) | (b(e(f29, f18, f26) * 256.0f) << 8);
    }

    public static float e(float f15, float f16, float f17) {
        float f18;
        if (f17 < 0.0f) {
            f17 += 6.0f;
        }
        if (f17 >= 6.0f) {
            f17 -= 6.0f;
        }
        if (f17 < 1.0f) {
            f18 = (f16 - f15) * f17;
        } else if (f17 < 3.0f) {
            return f16;
        } else {
            if (f17 >= 4.0f) {
                return f15;
            }
            f18 = (f16 - f15) * (4.0f - f17);
        }
        return f18 + f15;
    }

    public static g.f o(String str) {
        int i15;
        long j15;
        int i16 = 5;
        if (str.charAt(0) == '#') {
            int length = str.length();
            c cVar = null;
            if (1 < length) {
                long j16 = 0;
                int i17 = 1;
                while (true) {
                    if (i17 >= length) {
                        break;
                    }
                    char charAt = str.charAt(i17);
                    if (charAt < '0' || charAt > '9') {
                        if (charAt < 'A' || charAt > 'F') {
                            if (charAt < 'a' || charAt > 'f') {
                                break;
                            }
                            j15 = j16 * 16;
                            i15 = charAt - 'a';
                        } else {
                            j15 = j16 * 16;
                            i15 = charAt - 'A';
                        }
                        j16 = j15 + ((long) i15) + 10;
                    } else {
                        j16 = (j16 * 16) + ((long) (charAt - '0'));
                    }
                    if (j16 > Util.MAX_32BIT_VALUE) {
                        break;
                    }
                    i17++;
                }
                if (i17 != 1) {
                    cVar = new c(j16, i17);
                }
            }
            if (cVar != null) {
                int i18 = cVar.f198258a;
                if (i18 == 4) {
                    int i19 = (int) cVar.f198259b;
                    int i25 = i19 & 3840;
                    int i26 = i19 & 240;
                    int i27 = i19 & 15;
                    return new g.f(i27 | (i25 << 8) | -16777216 | (i25 << 12) | (i26 << 8) | (i26 << 4) | (i27 << 4));
                } else if (i18 == 5) {
                    int i28 = (int) cVar.f198259b;
                    int i29 = 61440 & i28;
                    int i35 = i28 & 3840;
                    int i36 = i28 & 240;
                    int i37 = i28 & 15;
                    return new g.f((i37 << 24) | (i37 << 28) | (i29 << 8) | (i29 << 4) | (i35 << 4) | i35 | i36 | (i36 >> 4));
                } else if (i18 == 7) {
                    return new g.f(((int) cVar.f198259b) | -16777216);
                } else {
                    if (i18 == 9) {
                        long j17 = cVar.f198259b;
                        return new g.f((((int) j17) >>> 8) | (((int) j17) << 24));
                    }
                    throw new i("Bad hex colour value: " + str);
                }
            } else {
                throw new i("Bad hex colour value: " + str);
            }
        } else {
            String lowerCase = str.toLowerCase(Locale.US);
            boolean startsWith = lowerCase.startsWith("rgba(");
            if (startsWith || lowerCase.startsWith("rgb(")) {
                if (!startsWith) {
                    i16 = 4;
                }
                i iVar = new i(str.substring(i16));
                iVar.q();
                float i38 = iVar.i();
                if (!Float.isNaN(i38) && iVar.d('%')) {
                    i38 = (i38 * 256.0f) / 100.0f;
                }
                float c15 = iVar.c(i38);
                if (!Float.isNaN(c15) && iVar.d('%')) {
                    c15 = (c15 * 256.0f) / 100.0f;
                }
                float c16 = iVar.c(c15);
                if (!Float.isNaN(c16) && iVar.d('%')) {
                    c16 = (c16 * 256.0f) / 100.0f;
                }
                if (startsWith) {
                    float c17 = iVar.c(c16);
                    iVar.q();
                    if (!Float.isNaN(c17) && iVar.d(')')) {
                        return new g.f((b(c17 * 256.0f) << 24) | (b(i38) << 16) | (b(c15) << 8) | b(c16));
                    }
                    throw new i("Bad rgba() colour value: " + str);
                }
                iVar.q();
                if (!Float.isNaN(c16) && iVar.d(')')) {
                    return new g.f((b(i38) << 16) | -16777216 | (b(c15) << 8) | b(c16));
                }
                throw new i("Bad rgb() colour value: " + str);
            }
            boolean startsWith2 = lowerCase.startsWith("hsla(");
            if (startsWith2 || lowerCase.startsWith("hsl(")) {
                if (!startsWith2) {
                    i16 = 4;
                }
                i iVar2 = new i(str.substring(i16));
                iVar2.q();
                float i39 = iVar2.i();
                float c18 = iVar2.c(i39);
                if (!Float.isNaN(c18)) {
                    iVar2.d('%');
                }
                float c19 = iVar2.c(c18);
                if (!Float.isNaN(c19)) {
                    iVar2.d('%');
                }
                if (startsWith2) {
                    float c25 = iVar2.c(c19);
                    iVar2.q();
                    if (!Float.isNaN(c25) && iVar2.d(')')) {
                        return new g.f((b(c25 * 256.0f) << 24) | d(i39, c18, c19));
                    }
                    throw new i("Bad hsla() colour value: " + str);
                }
                iVar2.q();
                if (!Float.isNaN(c19) && iVar2.d(')')) {
                    return new g.f(d(i39, c18, c19) | -16777216);
                }
                throw new i("Bad hsl() colour value: " + str);
            }
            Integer num = (Integer) ((HashMap) c.f198533a).get(lowerCase);
            if (num != null) {
                return new g.f(num.intValue());
            }
            throw new i("Invalid colour keyword: " + lowerCase);
        }
    }

    public static g.o0 p(String str) {
        str.getClass();
        if (str.equals("none")) {
            return g.f.f198380f;
        }
        if (str.equals("currentColor")) {
            return g.C2117g.f198386d;
        }
        try {
            return o(str);
        } catch (i unused) {
            return null;
        }
    }

    public static float q(String str) {
        int length = str.length();
        if (length != 0) {
            return r(str, 0, length);
        }
        throw new i("Invalid float value (empty string)");
    }

    public static float r(String str, int i15, int i16) {
        float a15 = new d().a(str, i15, i16);
        if (!Float.isNaN(a15)) {
            return a15;
        }
        throw new i("Invalid float value: " + str);
    }

    public static List<String> s(String str) {
        i iVar = new i(str);
        ArrayList arrayList = null;
        do {
            String k15 = iVar.k();
            if (k15 == null) {
                k15 = iVar.m(',', true);
            }
            if (k15 == null) {
                break;
            }
            if (arrayList == null) {
                arrayList = new ArrayList();
            }
            arrayList.add(k15);
            iVar.p();
        } while (!iVar.f());
        return arrayList;
    }

    public static g.e0.b t(String str) {
        str.getClass();
        char c15 = 65535;
        switch (str.hashCode()) {
            case -1657669071:
                if (str.equals("oblique")) {
                    c15 = 0;
                    break;
                }
                break;
            case -1178781136:
                if (str.equals("italic")) {
                    c15 = 1;
                    break;
                }
                break;
            case -1039745817:
                if (str.equals("normal")) {
                    c15 = 2;
                    break;
                }
                break;
        }
        switch (c15) {
            case 0:
                return g.e0.b.Oblique;
            case 1:
                return g.e0.b.Italic;
            case 2:
                return g.e0.b.Normal;
            default:
                return null;
        }
    }

    public static String u(String str, String str2) {
        if (str.equals("none") || !str.startsWith("url(")) {
            return null;
        }
        if (str.endsWith(")")) {
            return str.substring(4, str.length() - 1).trim();
        }
        return str.substring(4).trim();
    }

    public static g.p v(String str) {
        if (str.length() != 0) {
            int length = str.length();
            g.d1 d1Var = g.d1.f198312d;
            char charAt = str.charAt(length - 1);
            if (charAt == '%') {
                length--;
                d1Var = g.d1.f198316h;
            } else if (length > 2 && Character.isLetter(charAt) && Character.isLetter(str.charAt(length - 2))) {
                length -= 2;
                try {
                    d1Var = g.d1.valueOf(str.substring(length).toLowerCase(Locale.US));
                } catch (IllegalArgumentException unused) {
                    throw new i("Invalid length unit specifier: " + str);
                }
            }
            try {
                return new g.p(r(str, 0, length), d1Var);
            } catch (NumberFormatException e15) {
                throw new i("Invalid length value: " + str, e15);
            }
        } else {
            throw new i("Invalid length value (empty string)");
        }
    }

    public static List<g.p> w(String str) {
        if (str.length() != 0) {
            ArrayList arrayList = new ArrayList(1);
            i iVar = new i(str);
            iVar.q();
            while (!iVar.f()) {
                float i15 = iVar.i();
                if (Float.isNaN(i15)) {
                    StringBuilder sb5 = new StringBuilder();
                    sb5.append("Invalid length list value: ");
                    int i16 = iVar.f198550b;
                    while (!iVar.f() && !iVar.g(iVar.f198549a.charAt(iVar.f198550b))) {
                        iVar.f198550b++;
                    }
                    String substring = iVar.f198549a.substring(i16, iVar.f198550b);
                    iVar.f198550b = i16;
                    sb5.append(substring);
                    throw new i(sb5.toString());
                }
                g.d1 n15 = iVar.n();
                if (n15 == null) {
                    n15 = g.d1.f198312d;
                }
                arrayList.add(new g.p(i15, n15));
                iVar.p();
            }
            return arrayList;
        }
        throw new i("Invalid length list (empty string)");
    }

    public static g.p x(i iVar) {
        if (iVar.e("auto")) {
            return new g.p(0.0f);
        }
        return iVar.j();
    }

    public static Float y(String str) {
        try {
            float q15 = q(str);
            if (q15 < 0.0f) {
                q15 = 0.0f;
            } else if (q15 > 1.0f) {
                q15 = 1.0f;
            }
            return Float.valueOf(q15);
        } catch (i unused) {
            return null;
        }
    }

    public static g.o0 z(String str) {
        if (!str.startsWith("url(")) {
            return p(str);
        }
        int indexOf = str.indexOf(")");
        g.o0 o0Var = null;
        if (indexOf == -1) {
            return new g.u(str.substring(4).trim(), null);
        }
        String trim = str.substring(4, indexOf).trim();
        String trim2 = str.substring(indexOf + 1).trim();
        if (trim2.length() > 0) {
            o0Var = p(trim2);
        }
        return new g.u(trim, o0Var);
    }

    public final Map<String, String> B(i iVar) {
        HashMap hashMap = new HashMap();
        iVar.q();
        String m15 = iVar.m('=', false);
        while (m15 != null) {
            iVar.d('=');
            hashMap.put(m15, iVar.k());
            iVar.q();
            m15 = iVar.m('=', false);
        }
        return hashMap;
    }

    public final Matrix C(String str) {
        Matrix matrix = new Matrix();
        i iVar = new i(str);
        iVar.q();
        while (!iVar.f()) {
            String str2 = null;
            if (!iVar.f()) {
                int i15 = iVar.f198550b;
                int charAt = iVar.f198549a.charAt(i15);
                while (true) {
                    if ((charAt < 97 || charAt > 122) && (charAt < 65 || charAt > 90)) {
                        int i16 = iVar.f198550b;
                    } else {
                        charAt = iVar.a();
                    }
                }
                int i162 = iVar.f198550b;
                while (iVar.g(charAt)) {
                    charAt = iVar.a();
                }
                if (charAt == 40) {
                    iVar.f198550b++;
                    str2 = iVar.f198549a.substring(i15, i162);
                } else {
                    iVar.f198550b = i15;
                }
            }
            if (str2 != null) {
                char c15 = 65535;
                switch (str2.hashCode()) {
                    case -1081239615:
                        if (str2.equals("matrix")) {
                            c15 = 0;
                            break;
                        }
                        break;
                    case -925180581:
                        if (str2.equals(FFmpegMetadataRetriever.METADATA_KEY_VIDEO_ROTATION)) {
                            c15 = 1;
                            break;
                        }
                        break;
                    case 109250890:
                        if (str2.equals("scale")) {
                            c15 = 2;
                            break;
                        }
                        break;
                    case 109493390:
                        if (str2.equals("skewX")) {
                            c15 = 3;
                            break;
                        }
                        break;
                    case 109493391:
                        if (str2.equals("skewY")) {
                            c15 = 4;
                            break;
                        }
                        break;
                    case 1052832078:
                        if (str2.equals("translate")) {
                            c15 = 5;
                            break;
                        }
                        break;
                }
                switch (c15) {
                    case 0:
                        iVar.q();
                        float i17 = iVar.i();
                        iVar.p();
                        float i18 = iVar.i();
                        iVar.p();
                        float i19 = iVar.i();
                        iVar.p();
                        float i25 = iVar.i();
                        iVar.p();
                        float i26 = iVar.i();
                        iVar.p();
                        float i27 = iVar.i();
                        iVar.q();
                        if (!Float.isNaN(i27) && iVar.d(')')) {
                            Matrix matrix2 = new Matrix();
                            matrix2.setValues(new float[]{i17, i19, i26, i18, i25, i27, 0.0f, 0.0f, 1.0f});
                            matrix.preConcat(matrix2);
                            break;
                        } else {
                            throw new i("Invalid transform list: " + str);
                        }
                        break;
                    case 1:
                        iVar.q();
                        float i28 = iVar.i();
                        float o15 = iVar.o();
                        float o16 = iVar.o();
                        iVar.q();
                        if (Float.isNaN(i28) || !iVar.d(')')) {
                            throw new i("Invalid transform list: " + str);
                        } else if (Float.isNaN(o15)) {
                            matrix.preRotate(i28);
                            break;
                        } else if (!Float.isNaN(o16)) {
                            matrix.preRotate(i28, o15, o16);
                            break;
                        } else {
                            throw new i("Invalid transform list: " + str);
                        }
                    case 2:
                        iVar.q();
                        float i29 = iVar.i();
                        float o17 = iVar.o();
                        iVar.q();
                        if (!Float.isNaN(i29) && iVar.d(')')) {
                            if (!Float.isNaN(o17)) {
                                matrix.preScale(i29, o17);
                                break;
                            } else {
                                matrix.preScale(i29, i29);
                                break;
                            }
                        } else {
                            throw new i("Invalid transform list: " + str);
                        }
                        break;
                    case 3:
                        iVar.q();
                        float i35 = iVar.i();
                        iVar.q();
                        if (!Float.isNaN(i35) && iVar.d(')')) {
                            matrix.preSkew((float) Math.tan(Math.toRadians((double) i35)), 0.0f);
                            break;
                        } else {
                            throw new i("Invalid transform list: " + str);
                        }
                        break;
                    case 4:
                        iVar.q();
                        float i36 = iVar.i();
                        iVar.q();
                        if (!Float.isNaN(i36) && iVar.d(')')) {
                            matrix.preSkew(0.0f, (float) Math.tan(Math.toRadians((double) i36)));
                            break;
                        } else {
                            throw new i("Invalid transform list: " + str);
                        }
                    case 5:
                        iVar.q();
                        float i37 = iVar.i();
                        float o18 = iVar.o();
                        iVar.q();
                        if (!Float.isNaN(i37) && iVar.d(')')) {
                            if (!Float.isNaN(o18)) {
                                matrix.preTranslate(i37, o18);
                                break;
                            } else {
                                matrix.preTranslate(i37, 0.0f);
                                break;
                            }
                        } else {
                            throw new i("Invalid transform list: " + str);
                        }
                        break;
                    default:
                        throw new i("Invalid transform list fn: " + str2 + ")");
                }
                if (iVar.f()) {
                    return matrix;
                }
                iVar.p();
            } else {
                throw new i("Bad transform function encountered in transform list: " + str);
            }
        }
        return matrix;
    }

    public final void D(InputStream inputStream) {
        try {
            SAXParserFactory newInstance = SAXParserFactory.newInstance();
            newInstance.setFeature("http://xml.org/sax/features/external-general-entities", false);
            newInstance.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
            XMLReader xMLReader = newInstance.newSAXParser().getXMLReader();
            f fVar = new f(null);
            xMLReader.setContentHandler(fVar);
            xMLReader.setProperty("http://xml.org/sax/properties/lexical-handler", fVar);
            xMLReader.parse(new InputSource(inputStream));
        } catch (ParserConfigurationException e15) {
            throw new i("XML parser problem", e15);
        } catch (SAXException e16) {
            throw new i("SVG parse error", e16);
        } catch (IOException e17) {
            throw new i("Stream error", e17);
        }
    }

    public final void E(InputStream inputStream) {
        try {
            XmlPullParser newPullParser = Xml.newPullParser();
            C2119j jVar = new C2119j(this, newPullParser);
            newPullParser.setFeature("http://xmlpull.org/v1/doc/features.html#process-docdecl", false);
            newPullParser.setFeature("http://xmlpull.org/v1/doc/features.html#process-namespaces", true);
            newPullParser.setInput(inputStream, null);
            for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.nextToken()) {
                if (eventType == 0) {
                    this.f198523a = new g();
                } else if (eventType == 8) {
                    i iVar = new i(newPullParser.getText());
                    String l15 = iVar.l();
                    B(iVar);
                    l15.equals("xml-stylesheet");
                } else if (eventType == 2) {
                    String name = newPullParser.getName();
                    if (newPullParser.getPrefix() != null) {
                        name = newPullParser.getPrefix() + ':' + name;
                    }
                    I(newPullParser.getNamespace(), newPullParser.getName(), name, jVar);
                } else if (eventType == 3) {
                    String name2 = newPullParser.getName();
                    if (newPullParser.getPrefix() != null) {
                        name2 = newPullParser.getPrefix() + ':' + name2;
                    }
                    c(newPullParser.getNamespace(), newPullParser.getName(), name2);
                } else if (eventType == 4) {
                    int[] iArr = new int[2];
                    L(newPullParser.getTextCharacters(iArr), iArr[0], iArr[1]);
                } else if (eventType == 5) {
                    K(newPullParser.getText());
                }
            }
        } catch (XmlPullParserException e15) {
            throw new i("XML parser problem", e15);
        } catch (IOException e16) {
            throw new i("Stream error", e16);
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:64:0x00db, code lost:
        continue;
     */
    public final void F(Attributes attributes) {
        if (this.f198524b != null) {
            g.y yVar = new g.y();
            yVar.f198422a = this.f198523a;
            yVar.f198423b = this.f198524b;
            h(yVar, attributes);
            k(yVar, attributes);
            g(yVar, attributes);
            n(yVar, attributes);
            for (int i15 = 0; i15 < attributes.getLength(); i15++) {
                String trim = attributes.getValue(i15).trim();
                int ordinal = g.a(attributes.getLocalName(i15)).ordinal();
                if (ordinal == 25) {
                    g.p v15 = v(trim);
                    yVar.f198470w = v15;
                    if (v15.f()) {
                        throw new i("Invalid <pattern> element. height cannot be negative");
                    }
                } else if (ordinal != 26) {
                    switch (ordinal) {
                        case 44:
                            if ("objectBoundingBox".equals(trim)) {
                                yVar.f198465r = Boolean.FALSE;
                                continue;
                            } else if ("userSpaceOnUse".equals(trim)) {
                                yVar.f198465r = Boolean.TRUE;
                                break;
                            } else {
                                throw new i("Invalid value for attribute patternContentUnits");
                            }
                        case 45:
                            yVar.f198466s = C(trim);
                            continue;
                        case 46:
                            if ("objectBoundingBox".equals(trim)) {
                                yVar.f198464q = Boolean.FALSE;
                                continue;
                            } else if ("userSpaceOnUse".equals(trim)) {
                                yVar.f198464q = Boolean.TRUE;
                                break;
                            } else {
                                throw new i("Invalid value for attribute patternUnits");
                            }
                        default:
                            switch (ordinal) {
                                case 81:
                                    g.p v16 = v(trim);
                                    yVar.f198469v = v16;
                                    if (!v16.f()) {
                                        continue;
                                    } else {
                                        throw new i("Invalid <pattern> element. width cannot be negative");
                                    }
                                case 82:
                                    yVar.f198467t = v(trim);
                                    continue;
                                case 83:
                                    yVar.f198468u = v(trim);
                                    continue;
                                    continue;
                            }
                    }
                } else if ("".equals(attributes.getURI(i15)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i15))) {
                    yVar.f198471x = trim;
                }
            }
            this.f198524b.a(yVar);
            this.f198524b = yVar;
            return;
        }
        throw new i("Invalid document. Root element must be <svg>");
    }

    public final void H(Attributes attributes) {
        if (this.f198524b != null) {
            g.c0 c0Var = new g.c0();
            c0Var.f198422a = this.f198523a;
            c0Var.f198423b = this.f198524b;
            h(c0Var, attributes);
            k(c0Var, attributes);
            this.f198524b.a(c0Var);
            this.f198524b = c0Var;
            return;
        }
        throw new i("Invalid document. Root element must be <svg>");
    }

    /* JADX WARNING: Code restructure failed: missing block: B:573:0x00e7, code lost:
        continue;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:596:0x041e, code lost:
        continue;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:656:0x09f5, code lost:
        continue;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:688:0x0c9f, code lost:
        continue;
     */
    /* JADX WARNING: Removed duplicated region for block: B:329:0x077e  */
    /* JADX WARNING: Removed duplicated region for block: B:625:0x07af A[SYNTHETIC] */
    public final void I(String str, String str2, String str3, Attributes attributes) {
        String str4;
        boolean z15;
        char charAt;
        float f15;
        float f16;
        float f17;
        float f18;
        float f19;
        float f25;
        float f26;
        float f27;
        boolean z16;
        boolean z17;
        if (this.f198525c) {
            this.f198526d++;
        } else if ("http://www.w3.org/2000/svg".equals(str) || "".equals(str)) {
            if (str2.length() > 0) {
                str4 = str2;
            } else {
                str4 = str3;
            }
            h hVar = (h) ((HashMap) h.f198547h).get(str4);
            if (hVar == null) {
                hVar = h.f198546g;
            }
            int i15 = 0;
            switch (hVar.ordinal()) {
                case 0:
                    g.f0 f0Var = new g.f0();
                    f0Var.f198422a = this.f198523a;
                    f0Var.f198423b = this.f198524b;
                    h(f0Var, attributes);
                    k(f0Var, attributes);
                    g(f0Var, attributes);
                    n(f0Var, attributes);
                    while (i15 < attributes.getLength()) {
                        String trim = attributes.getValue(i15).trim();
                        int ordinal = g.a(attributes.getLocalName(i15)).ordinal();
                        if (ordinal == 25) {
                            g.p v15 = v(trim);
                            f0Var.f198385t = v15;
                            if (v15.f()) {
                                throw new i("Invalid <svg> element. height cannot be negative");
                            }
                        } else if (ordinal != 79) {
                            switch (ordinal) {
                                case 81:
                                    g.p v16 = v(trim);
                                    f0Var.f198384s = v16;
                                    if (!v16.f()) {
                                        continue;
                                    } else {
                                        throw new i("Invalid <svg> element. width cannot be negative");
                                    }
                                case 82:
                                    f0Var.f198382q = v(trim);
                                    continue;
                                case 83:
                                    f0Var.f198383r = v(trim);
                                    continue;
                            }
                        } else {
                            continue;
                        }
                        i15++;
                    }
                    g.j0 j0Var = this.f198524b;
                    if (j0Var == null) {
                        this.f198523a.f198286a = f0Var;
                    } else {
                        j0Var.a(f0Var);
                    }
                    this.f198524b = f0Var;
                    return;
                case 1:
                    if (this.f198524b != null) {
                        g.a aVar = new g.a();
                        aVar.f198422a = this.f198523a;
                        aVar.f198423b = this.f198524b;
                        h(aVar, attributes);
                        k(aVar, attributes);
                        m(aVar, attributes);
                        g(aVar, attributes);
                        while (i15 < attributes.getLength()) {
                            attributes.getValue(i15).getClass();
                            if (g.a(attributes.getLocalName(i15)).ordinal() == 26 && !"".equals(attributes.getURI(i15))) {
                                "http://www.w3.org/1999/xlink".equals(attributes.getURI(i15));
                            }
                            i15++;
                        }
                        this.f198524b.a(aVar);
                        this.f198524b = aVar;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 2:
                    if (this.f198524b != null) {
                        g.d dVar = new g.d();
                        dVar.f198422a = this.f198523a;
                        dVar.f198423b = this.f198524b;
                        h(dVar, attributes);
                        k(dVar, attributes);
                        m(dVar, attributes);
                        g(dVar, attributes);
                        while (i15 < attributes.getLength()) {
                            String trim2 = attributes.getValue(i15).trim();
                            int ordinal2 = g.a(attributes.getLocalName(i15)).ordinal();
                            if (ordinal2 == 6) {
                                dVar.f198308o = v(trim2);
                            } else if (ordinal2 == 7) {
                                dVar.f198309p = v(trim2);
                            } else if (ordinal2 != 49) {
                                continue;
                            } else {
                                g.p v17 = v(trim2);
                                dVar.f198310q = v17;
                                if (v17.f()) {
                                    throw new i("Invalid <circle> element. r cannot be negative");
                                }
                            }
                            i15++;
                        }
                        this.f198524b.a(dVar);
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 3:
                    if (this.f198524b != null) {
                        g.e eVar = new g.e();
                        eVar.f198422a = this.f198523a;
                        eVar.f198423b = this.f198524b;
                        h(eVar, attributes);
                        k(eVar, attributes);
                        m(eVar, attributes);
                        g(eVar, attributes);
                        while (i15 < attributes.getLength()) {
                            String trim3 = attributes.getValue(i15).trim();
                            if (g.a(attributes.getLocalName(i15)).ordinal() == 3) {
                                if ("objectBoundingBox".equals(trim3)) {
                                    eVar.f198318p = Boolean.FALSE;
                                } else if ("userSpaceOnUse".equals(trim3)) {
                                    eVar.f198318p = Boolean.TRUE;
                                } else {
                                    throw new i("Invalid value for attribute clipPathUnits");
                                }
                            }
                            i15++;
                        }
                        this.f198524b.a(eVar);
                        this.f198524b = eVar;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 4:
                    if (this.f198524b != null) {
                        g.h hVar2 = new g.h();
                        hVar2.f198422a = this.f198523a;
                        hVar2.f198423b = this.f198524b;
                        h(hVar2, attributes);
                        k(hVar2, attributes);
                        m(hVar2, attributes);
                        this.f198524b.a(hVar2);
                        this.f198524b = hVar2;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 5:
                case 26:
                    this.f198527e = true;
                    this.f198528f = hVar;
                    return;
                case 6:
                    if (this.f198524b != null) {
                        g.i iVar = new g.i();
                        iVar.f198422a = this.f198523a;
                        iVar.f198423b = this.f198524b;
                        h(iVar, attributes);
                        k(iVar, attributes);
                        m(iVar, attributes);
                        g(iVar, attributes);
                        while (i15 < attributes.getLength()) {
                            String trim4 = attributes.getValue(i15).trim();
                            int ordinal3 = g.a(attributes.getLocalName(i15)).ordinal();
                            if (ordinal3 == 6) {
                                iVar.f198393o = v(trim4);
                            } else if (ordinal3 == 7) {
                                iVar.f198394p = v(trim4);
                            } else if (ordinal3 == 56) {
                                g.p v18 = v(trim4);
                                iVar.f198395q = v18;
                                if (v18.f()) {
                                    throw new i("Invalid <ellipse> element. rx cannot be negative");
                                }
                            } else if (ordinal3 != 57) {
                                continue;
                            } else {
                                g.p v19 = v(trim4);
                                iVar.f198396r = v19;
                                if (v19.f()) {
                                    throw new i("Invalid <ellipse> element. ry cannot be negative");
                                }
                            }
                            i15++;
                        }
                        this.f198524b.a(iVar);
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 7:
                    if (this.f198524b != null) {
                        g.m mVar = new g.m();
                        mVar.f198422a = this.f198523a;
                        mVar.f198423b = this.f198524b;
                        h(mVar, attributes);
                        k(mVar, attributes);
                        m(mVar, attributes);
                        g(mVar, attributes);
                        this.f198524b.a(mVar);
                        this.f198524b = mVar;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 8:
                    if (this.f198524b != null) {
                        g.o oVar = new g.o();
                        oVar.f198422a = this.f198523a;
                        oVar.f198423b = this.f198524b;
                        h(oVar, attributes);
                        k(oVar, attributes);
                        m(oVar, attributes);
                        g(oVar, attributes);
                        while (i15 < attributes.getLength()) {
                            String trim5 = attributes.getValue(i15).trim();
                            int ordinal4 = g.a(attributes.getLocalName(i15)).ordinal();
                            if (ordinal4 == 25) {
                                g.p v25 = v(trim5);
                                oVar.f198428t = v25;
                                if (v25.f()) {
                                    throw new i("Invalid <use> element. height cannot be negative");
                                }
                            } else if (ordinal4 != 26) {
                                if (ordinal4 != 48) {
                                    switch (ordinal4) {
                                        case 81:
                                            g.p v26 = v(trim5);
                                            oVar.f198427s = v26;
                                            if (!v26.f()) {
                                                continue;
                                            } else {
                                                throw new i("Invalid <use> element. width cannot be negative");
                                            }
                                        case 82:
                                            oVar.f198425q = v(trim5);
                                            continue;
                                        case 83:
                                            oVar.f198426r = v(trim5);
                                            continue;
                                    }
                                } else {
                                    A(oVar, trim5);
                                }
                            } else if ("".equals(attributes.getURI(i15)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i15))) {
                                oVar.f198424p = trim5;
                            }
                            i15++;
                        }
                        this.f198524b.a(oVar);
                        this.f198524b = oVar;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 9:
                    if (this.f198524b != null) {
                        g.q qVar = new g.q();
                        qVar.f198422a = this.f198523a;
                        qVar.f198423b = this.f198524b;
                        h(qVar, attributes);
                        k(qVar, attributes);
                        m(qVar, attributes);
                        g(qVar, attributes);
                        while (i15 < attributes.getLength()) {
                            String trim6 = attributes.getValue(i15).trim();
                            switch (g.a(attributes.getLocalName(i15)).ordinal()) {
                                case 84:
                                    qVar.f198433o = v(trim6);
                                    break;
                                case 85:
                                    qVar.f198434p = v(trim6);
                                    break;
                                case 86:
                                    qVar.f198435q = v(trim6);
                                    break;
                                case 87:
                                    qVar.f198436r = v(trim6);
                                    break;
                            }
                            i15++;
                        }
                        this.f198524b.a(qVar);
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 10:
                    if (this.f198524b != null) {
                        g.m0 m0Var = new g.m0();
                        m0Var.f198422a = this.f198523a;
                        m0Var.f198423b = this.f198524b;
                        h(m0Var, attributes);
                        k(m0Var, attributes);
                        i(m0Var, attributes);
                        while (i15 < attributes.getLength()) {
                            String trim7 = attributes.getValue(i15).trim();
                            switch (g.a(attributes.getLocalName(i15)).ordinal()) {
                                case 84:
                                    m0Var.f198418m = v(trim7);
                                    break;
                                case 85:
                                    m0Var.f198419n = v(trim7);
                                    break;
                                case 86:
                                    m0Var.f198420o = v(trim7);
                                    break;
                                case 87:
                                    m0Var.f198421p = v(trim7);
                                    break;
                            }
                            i15++;
                        }
                        this.f198524b.a(m0Var);
                        this.f198524b = m0Var;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 11:
                    if (this.f198524b != null) {
                        g.r rVar = new g.r();
                        rVar.f198422a = this.f198523a;
                        rVar.f198423b = this.f198524b;
                        h(rVar, attributes);
                        k(rVar, attributes);
                        g(rVar, attributes);
                        n(rVar, attributes);
                        for (int i16 = 0; i16 < attributes.getLength(); i16++) {
                            String trim8 = attributes.getValue(i16).trim();
                            int ordinal5 = g.a(attributes.getLocalName(i16)).ordinal();
                            if (ordinal5 != 41) {
                                if (ordinal5 == 50) {
                                    rVar.f198443r = v(trim8);
                                } else if (ordinal5 != 51) {
                                    switch (ordinal5) {
                                        case 32:
                                            g.p v27 = v(trim8);
                                            rVar.f198446u = v27;
                                            if (v27.f()) {
                                                throw new i("Invalid <marker> element. markerHeight cannot be negative");
                                            }
                                            break;
                                        case 33:
                                            if ("strokeWidth".equals(trim8)) {
                                                rVar.f198442q = false;
                                                break;
                                            } else if ("userSpaceOnUse".equals(trim8)) {
                                                rVar.f198442q = true;
                                                break;
                                            } else {
                                                throw new i("Invalid value for attribute markerUnits");
                                            }
                                        case 34:
                                            g.p v28 = v(trim8);
                                            rVar.f198445t = v28;
                                            if (v28.f()) {
                                                throw new i("Invalid <marker> element. markerWidth cannot be negative");
                                            }
                                    }
                                } else {
                                    rVar.f198444s = v(trim8);
                                }
                            } else if ("auto".equals(trim8)) {
                                rVar.f198447v = Float.valueOf(Float.NaN);
                            } else {
                                rVar.f198447v = Float.valueOf(q(trim8));
                            }
                        }
                        this.f198524b.a(rVar);
                        this.f198524b = rVar;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 12:
                    f(attributes);
                    return;
                case 13:
                    if (this.f198524b != null) {
                        g.v vVar = new g.v();
                        vVar.f198422a = this.f198523a;
                        vVar.f198423b = this.f198524b;
                        h(vVar, attributes);
                        k(vVar, attributes);
                        m(vVar, attributes);
                        g(vVar, attributes);
                        for (int i17 = 0; i17 < attributes.getLength(); i17++) {
                            String trim9 = attributes.getValue(i17).trim();
                            int ordinal6 = g.a(attributes.getLocalName(i17)).ordinal();
                            if (ordinal6 == 13) {
                                i iVar2 = new i(trim9);
                                g.w wVar = new g.w();
                                if (!iVar2.f()) {
                                    int intValue = iVar2.h().intValue();
                                    char c15 = 'm';
                                    if (intValue == 77 || intValue == 109) {
                                        float f28 = 0.0f;
                                        float f29 = 0.0f;
                                        float f35 = 0.0f;
                                        float f36 = 0.0f;
                                        float f37 = 0.0f;
                                        float f38 = 0.0f;
                                        while (true) {
                                            iVar2.q();
                                            int i18 = 108;
                                            switch (intValue) {
                                                case 65:
                                                case 97:
                                                    f16 = f37;
                                                    float i19 = iVar2.i();
                                                    float c16 = iVar2.c(i19);
                                                    float c17 = iVar2.c(c16);
                                                    Boolean b15 = iVar2.b(Float.valueOf(c17));
                                                    Boolean b16 = iVar2.b(b15);
                                                    if (b16 == null) {
                                                        f18 = Float.NaN;
                                                    } else {
                                                        iVar2.p();
                                                        f18 = iVar2.i();
                                                    }
                                                    float c18 = iVar2.c(f18);
                                                    if (!Float.isNaN(c18) && i19 >= 0.0f && c16 >= 0.0f) {
                                                        f15 = f38;
                                                        if (intValue == 97) {
                                                            f18 += f28;
                                                            c18 += f35;
                                                        }
                                                        f28 = f18;
                                                        wVar.d(i19, c16, c17, b15.booleanValue(), b16.booleanValue(), f28, c18);
                                                        f29 = f28;
                                                        f17 = c18;
                                                        f35 = f17;
                                                        f36 = f35;
                                                        f37 = f16;
                                                        f38 = f15;
                                                        iVar2.p();
                                                        if (!iVar2.f()) {
                                                            break;
                                                        } else {
                                                            int i25 = iVar2.f198550b;
                                                            if (i25 != iVar2.f198551c && (((charAt = iVar2.f198549a.charAt(i25)) >= 'a' && charAt <= 'z') || (charAt >= 'A' && charAt <= 'Z'))) {
                                                                z15 = true;
                                                            } else {
                                                                z15 = false;
                                                            }
                                                            if (z15) {
                                                                intValue = iVar2.h().intValue();
                                                            }
                                                            c15 = 'm';
                                                        }
                                                    }
                                                    break;
                                                case 67:
                                                case 99:
                                                    float i26 = iVar2.i();
                                                    float c19 = iVar2.c(i26);
                                                    float c25 = iVar2.c(c19);
                                                    f36 = iVar2.c(c25);
                                                    float c26 = iVar2.c(f36);
                                                    float c27 = iVar2.c(c26);
                                                    if (Float.isNaN(c27)) {
                                                        break;
                                                    } else {
                                                        f26 = f37;
                                                        if (intValue == 99) {
                                                            c26 += f28;
                                                            c27 += f35;
                                                            i26 += f28;
                                                            c19 += f35;
                                                            c25 += f28;
                                                            f36 += f35;
                                                        }
                                                        f25 = c25;
                                                        f27 = c26;
                                                        wVar.b(i26, c19, f25, f36, f27, c27);
                                                        f35 = c27;
                                                        f19 = f27;
                                                        f37 = f26;
                                                        f29 = f25;
                                                        f28 = f19;
                                                        iVar2.p();
                                                        if (!iVar2.f()) {
                                                        }
                                                    }
                                                    break;
                                                case 72:
                                                case 104:
                                                    f25 = iVar2.i();
                                                    if (Float.isNaN(f25)) {
                                                        break;
                                                    } else {
                                                        if (intValue == 104) {
                                                            f25 += f28;
                                                        }
                                                        wVar.c(f25, f35);
                                                        f19 = f25;
                                                        f29 = f25;
                                                        f28 = f19;
                                                        iVar2.p();
                                                        if (!iVar2.f()) {
                                                        }
                                                    }
                                                    break;
                                                case 76:
                                                case 108:
                                                    float i27 = iVar2.i();
                                                    float c28 = iVar2.c(i27);
                                                    if (Float.isNaN(c28)) {
                                                        break;
                                                    } else {
                                                        if (intValue == 108) {
                                                            i27 += f28;
                                                            c28 += f35;
                                                        }
                                                        f28 = i27;
                                                        f17 = c28;
                                                        wVar.c(f28, f17);
                                                        f29 = f28;
                                                        f16 = f37;
                                                        f15 = f38;
                                                        f35 = f17;
                                                        f36 = f35;
                                                        f37 = f16;
                                                        f38 = f15;
                                                        iVar2.p();
                                                        if (!iVar2.f()) {
                                                        }
                                                    }
                                                    break;
                                                case 77:
                                                case 109:
                                                    float i28 = iVar2.i();
                                                    float c29 = iVar2.c(i28);
                                                    if (Float.isNaN(c29)) {
                                                        break;
                                                    } else {
                                                        if (intValue == 109) {
                                                            if (wVar.f198460b == 0) {
                                                                z16 = true;
                                                            } else {
                                                                z16 = false;
                                                            }
                                                            if (!z16) {
                                                                i28 += f28;
                                                                c29 += f35;
                                                            }
                                                        }
                                                        f37 = i28;
                                                        f35 = c29;
                                                        wVar.a(f37, f35);
                                                        if (intValue != 109) {
                                                            i18 = 76;
                                                        }
                                                        intValue = i18;
                                                        f36 = f35;
                                                        f38 = f36;
                                                        f25 = f37;
                                                        f19 = f25;
                                                        f29 = f25;
                                                        f28 = f19;
                                                        iVar2.p();
                                                        if (!iVar2.f()) {
                                                        }
                                                    }
                                                    break;
                                                case 81:
                                                case 113:
                                                    f25 = iVar2.i();
                                                    float c35 = iVar2.c(f25);
                                                    f19 = iVar2.c(c35);
                                                    float c36 = iVar2.c(f19);
                                                    if (Float.isNaN(c36)) {
                                                        break;
                                                    } else {
                                                        if (intValue == 113) {
                                                            f19 += f28;
                                                            c36 += f35;
                                                            f25 += f28;
                                                            c35 += f35;
                                                        }
                                                        f36 = c35;
                                                        f35 = c36;
                                                        wVar.e(f25, f36, f19, f35);
                                                        f29 = f25;
                                                        f28 = f19;
                                                        iVar2.p();
                                                        if (!iVar2.f()) {
                                                        }
                                                    }
                                                    break;
                                                case 83:
                                                case 115:
                                                    float f39 = (f28 * 2.0f) - f29;
                                                    float f45 = (2.0f * f35) - f36;
                                                    f25 = iVar2.i();
                                                    float c37 = iVar2.c(f25);
                                                    f27 = iVar2.c(c37);
                                                    float c38 = iVar2.c(f27);
                                                    if (Float.isNaN(c38)) {
                                                        break;
                                                    } else {
                                                        if (intValue == 115) {
                                                            f27 += f28;
                                                            c38 += f35;
                                                            f25 += f28;
                                                            c37 += f35;
                                                        }
                                                        wVar.b(f39, f45, f25, c37, f27, c38);
                                                        f35 = c38;
                                                        f26 = f37;
                                                        f36 = c37;
                                                        f19 = f27;
                                                        f37 = f26;
                                                        f29 = f25;
                                                        f28 = f19;
                                                        iVar2.p();
                                                        if (!iVar2.f()) {
                                                        }
                                                    }
                                                    break;
                                                case 84:
                                                case 116:
                                                    float f46 = (f28 * 2.0f) - f29;
                                                    float f47 = (2.0f * f35) - f36;
                                                    float i29 = iVar2.i();
                                                    float c39 = iVar2.c(i29);
                                                    if (Float.isNaN(c39)) {
                                                        break;
                                                    } else {
                                                        if (intValue == 116) {
                                                            i29 += f28;
                                                            c39 += f35;
                                                        }
                                                        wVar.e(f46, f47, i29, c39);
                                                        f35 = c39;
                                                        f28 = i29;
                                                        f36 = f47;
                                                        f29 = f46;
                                                        iVar2.p();
                                                        if (!iVar2.f()) {
                                                        }
                                                    }
                                                    break;
                                                case 86:
                                                case 118:
                                                    f17 = iVar2.i();
                                                    if (Float.isNaN(f17)) {
                                                        break;
                                                    } else {
                                                        if (intValue == 118) {
                                                            f17 += f35;
                                                        }
                                                        wVar.c(f28, f17);
                                                        f16 = f37;
                                                        f15 = f38;
                                                        f35 = f17;
                                                        f36 = f35;
                                                        f37 = f16;
                                                        f38 = f15;
                                                        iVar2.p();
                                                        if (!iVar2.f()) {
                                                        }
                                                    }
                                                    break;
                                                case 90:
                                                case 122:
                                                    wVar.close();
                                                    f28 = f37;
                                                    f29 = f28;
                                                    f16 = f29;
                                                    f17 = f38;
                                                    f15 = f17;
                                                    f35 = f17;
                                                    f36 = f35;
                                                    f37 = f16;
                                                    f38 = f15;
                                                    iVar2.p();
                                                    if (!iVar2.f()) {
                                                    }
                                                    break;
                                            }
                                        }
                                    }
                                }
                                vVar.f198457o = wVar;
                            } else if (ordinal6 == 43 && Float.valueOf(q(trim9)).floatValue() < 0.0f) {
                                throw new i("Invalid <path> element. pathLength cannot be negative");
                            }
                        }
                        this.f198524b.a(vVar);
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 14:
                    F(attributes);
                    return;
                case 15:
                    if (this.f198524b != null) {
                        g.z a0Var = new g.a0();
                        a0Var.f198422a = this.f198523a;
                        a0Var.f198423b = this.f198524b;
                        h(a0Var, attributes);
                        k(a0Var, attributes);
                        m(a0Var, attributes);
                        g(a0Var, attributes);
                        j(a0Var, attributes, "polygon");
                        this.f198524b.a(a0Var);
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 16:
                    if (this.f198524b != null) {
                        g.z zVar = new g.z();
                        zVar.f198422a = this.f198523a;
                        zVar.f198423b = this.f198524b;
                        h(zVar, attributes);
                        k(zVar, attributes);
                        m(zVar, attributes);
                        g(zVar, attributes);
                        j(zVar, attributes, "polyline");
                        this.f198524b.a(zVar);
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 17:
                    if (this.f198524b != null) {
                        g.q0 q0Var = new g.q0();
                        q0Var.f198422a = this.f198523a;
                        q0Var.f198423b = this.f198524b;
                        h(q0Var, attributes);
                        k(q0Var, attributes);
                        i(q0Var, attributes);
                        while (i15 < attributes.getLength()) {
                            String trim10 = attributes.getValue(i15).trim();
                            int ordinal7 = g.a(attributes.getLocalName(i15)).ordinal();
                            if (ordinal7 == 6) {
                                q0Var.f198437m = v(trim10);
                            } else if (ordinal7 == 7) {
                                q0Var.f198438n = v(trim10);
                            } else if (ordinal7 == 11) {
                                q0Var.f198440p = v(trim10);
                            } else if (ordinal7 == 12) {
                                q0Var.f198441q = v(trim10);
                            } else if (ordinal7 != 49) {
                                continue;
                            } else {
                                g.p v29 = v(trim10);
                                q0Var.f198439o = v29;
                                if (v29.f()) {
                                    throw new i("Invalid <radialGradient> element. r cannot be negative");
                                }
                            }
                            i15++;
                        }
                        this.f198524b.a(q0Var);
                        this.f198524b = q0Var;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 18:
                    if (this.f198524b != null) {
                        g.b0 b0Var = new g.b0();
                        b0Var.f198422a = this.f198523a;
                        b0Var.f198423b = this.f198524b;
                        h(b0Var, attributes);
                        k(b0Var, attributes);
                        m(b0Var, attributes);
                        g(b0Var, attributes);
                        while (i15 < attributes.getLength()) {
                            String trim11 = attributes.getValue(i15).trim();
                            int ordinal8 = g.a(attributes.getLocalName(i15)).ordinal();
                            if (ordinal8 == 25) {
                                g.p v35 = v(trim11);
                                b0Var.f198300r = v35;
                                if (v35.f()) {
                                    throw new i("Invalid <rect> element. height cannot be negative");
                                }
                            } else if (ordinal8 == 56) {
                                g.p v36 = v(trim11);
                                b0Var.f198301s = v36;
                                if (v36.f()) {
                                    throw new i("Invalid <rect> element. rx cannot be negative");
                                }
                            } else if (ordinal8 != 57) {
                                switch (ordinal8) {
                                    case 81:
                                        g.p v37 = v(trim11);
                                        b0Var.f198299q = v37;
                                        if (!v37.f()) {
                                            continue;
                                        } else {
                                            throw new i("Invalid <rect> element. width cannot be negative");
                                        }
                                    case 82:
                                        b0Var.f198297o = v(trim11);
                                        continue;
                                    case 83:
                                        b0Var.f198298p = v(trim11);
                                        continue;
                                }
                            } else {
                                g.p v38 = v(trim11);
                                b0Var.f198302t = v38;
                                if (v38.f()) {
                                    throw new i("Invalid <rect> element. ry cannot be negative");
                                }
                            }
                            i15++;
                        }
                        this.f198524b.a(b0Var);
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 19:
                    H(attributes);
                    return;
                case 20:
                    g.j0 j0Var2 = this.f198524b;
                    if (j0Var2 == null) {
                        throw new i("Invalid document. Root element must be <svg>");
                    } else if (j0Var2 instanceof g.j) {
                        g.d0 d0Var = new g.d0();
                        d0Var.f198422a = this.f198523a;
                        d0Var.f198423b = this.f198524b;
                        h(d0Var, attributes);
                        k(d0Var, attributes);
                        for (int i35 = 0; i35 < attributes.getLength(); i35++) {
                            String trim12 = attributes.getValue(i35).trim();
                            if (g.a(attributes.getLocalName(i35)).ordinal() == 39) {
                                if (trim12.length() != 0) {
                                    int length = trim12.length();
                                    if (trim12.charAt(trim12.length() - 1) == '%') {
                                        length--;
                                        z17 = true;
                                    } else {
                                        z17 = false;
                                    }
                                    try {
                                        float r15 = r(trim12, 0, length);
                                        float f48 = 100.0f;
                                        if (z17) {
                                            r15 /= 100.0f;
                                        }
                                        if (r15 < 0.0f) {
                                            f48 = 0.0f;
                                        } else if (r15 <= 100.0f) {
                                            f48 = r15;
                                        }
                                        d0Var.f198311h = Float.valueOf(f48);
                                    } catch (NumberFormatException e15) {
                                        throw new i("Invalid offset value in <stop>: " + trim12, e15);
                                    }
                                } else {
                                    throw new i("Invalid offset value in <stop> (empty string)");
                                }
                            }
                        }
                        this.f198524b.a(d0Var);
                        this.f198524b = d0Var;
                        return;
                    } else {
                        throw new i("Invalid document. <stop> elements are only valid inside <linearGradient> or <radialGradient> elements.");
                    }
                case 21:
                    J(attributes);
                    return;
                case 22:
                    if (this.f198524b != null) {
                        g.s0 s0Var = new g.s0();
                        s0Var.f198422a = this.f198523a;
                        s0Var.f198423b = this.f198524b;
                        h(s0Var, attributes);
                        k(s0Var, attributes);
                        m(s0Var, attributes);
                        g(s0Var, attributes);
                        this.f198524b.a(s0Var);
                        this.f198524b = s0Var;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 23:
                    if (this.f198524b != null) {
                        g.r0 t0Var = new g.t0();
                        t0Var.f198422a = this.f198523a;
                        t0Var.f198423b = this.f198524b;
                        h(t0Var, attributes);
                        k(t0Var, attributes);
                        g(t0Var, attributes);
                        n(t0Var, attributes);
                        this.f198524b.a(t0Var);
                        this.f198524b = t0Var;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 24:
                    if (this.f198524b != null) {
                        g.w0 w0Var = new g.w0();
                        w0Var.f198422a = this.f198523a;
                        w0Var.f198423b = this.f198524b;
                        h(w0Var, attributes);
                        k(w0Var, attributes);
                        m(w0Var, attributes);
                        g(w0Var, attributes);
                        l(w0Var, attributes);
                        this.f198524b.a(w0Var);
                        this.f198524b = w0Var;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 25:
                    if (this.f198524b != null) {
                        g.z0 z0Var = new g.z0();
                        z0Var.f198422a = this.f198523a;
                        z0Var.f198423b = this.f198524b;
                        h(z0Var, attributes);
                        k(z0Var, attributes);
                        g(z0Var, attributes);
                        while (i15 < attributes.getLength()) {
                            String trim13 = attributes.getValue(i15).trim();
                            int ordinal9 = g.a(attributes.getLocalName(i15)).ordinal();
                            if (ordinal9 != 26) {
                                if (ordinal9 == 61) {
                                    z0Var.f198474p = v(trim13);
                                }
                            } else if ("".equals(attributes.getURI(i15)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i15))) {
                                z0Var.f198473o = trim13;
                            }
                            i15++;
                        }
                        this.f198524b.a(z0Var);
                        this.f198524b = z0Var;
                        g.j0 j0Var3 = z0Var.f198423b;
                        if (j0Var3 instanceof g.b1) {
                            z0Var.f198475q = (g.b1) j0Var3;
                            return;
                        } else {
                            z0Var.f198475q = ((g.x0) j0Var3).b();
                            return;
                        }
                    } else {
                        throw new i("Invalid document. Root element must be <svg>");
                    }
                case 27:
                    g.j0 j0Var4 = this.f198524b;
                    if (j0Var4 == null) {
                        throw new i("Invalid document. Root element must be <svg>");
                    } else if (j0Var4 instanceof g.y0) {
                        g.u0 u0Var = new g.u0();
                        u0Var.f198422a = this.f198523a;
                        u0Var.f198423b = this.f198524b;
                        h(u0Var, attributes);
                        k(u0Var, attributes);
                        g(u0Var, attributes);
                        while (i15 < attributes.getLength()) {
                            String trim14 = attributes.getValue(i15).trim();
                            if (g.a(attributes.getLocalName(i15)).ordinal() == 26 && ("".equals(attributes.getURI(i15)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i15)))) {
                                u0Var.f198455o = trim14;
                            }
                            i15++;
                        }
                        this.f198524b.a(u0Var);
                        g.j0 j0Var5 = u0Var.f198423b;
                        if (j0Var5 instanceof g.b1) {
                            u0Var.f198456p = (g.b1) j0Var5;
                            return;
                        } else {
                            u0Var.f198456p = ((g.x0) j0Var5).b();
                            return;
                        }
                    } else {
                        throw new i("Invalid document. <tref> elements are only valid inside <text> or <tspan> elements.");
                    }
                case 28:
                    g.j0 j0Var6 = this.f198524b;
                    if (j0Var6 == null) {
                        throw new i("Invalid document. Root element must be <svg>");
                    } else if (j0Var6 instanceof g.y0) {
                        g.v0 v0Var = new g.v0();
                        v0Var.f198422a = this.f198523a;
                        v0Var.f198423b = this.f198524b;
                        h(v0Var, attributes);
                        k(v0Var, attributes);
                        g(v0Var, attributes);
                        l(v0Var, attributes);
                        this.f198524b.a(v0Var);
                        this.f198524b = v0Var;
                        g.j0 j0Var7 = v0Var.f198423b;
                        if (j0Var7 instanceof g.b1) {
                            v0Var.f198458s = (g.b1) j0Var7;
                            return;
                        } else {
                            v0Var.f198458s = ((g.x0) j0Var7).b();
                            return;
                        }
                    } else {
                        throw new i("Invalid document. <tspan> elements are only valid inside <text> or other <tspan> elements.");
                    }
                case 29:
                    if (this.f198524b != null) {
                        g.e1 e1Var = new g.e1();
                        e1Var.f198422a = this.f198523a;
                        e1Var.f198423b = this.f198524b;
                        h(e1Var, attributes);
                        k(e1Var, attributes);
                        m(e1Var, attributes);
                        g(e1Var, attributes);
                        while (i15 < attributes.getLength()) {
                            String trim15 = attributes.getValue(i15).trim();
                            int ordinal10 = g.a(attributes.getLocalName(i15)).ordinal();
                            if (ordinal10 == 25) {
                                g.p v39 = v(trim15);
                                e1Var.f198378t = v39;
                                if (v39.f()) {
                                    throw new i("Invalid <use> element. height cannot be negative");
                                }
                            } else if (ordinal10 != 26) {
                                switch (ordinal10) {
                                    case 81:
                                        g.p v45 = v(trim15);
                                        e1Var.f198377s = v45;
                                        if (!v45.f()) {
                                            continue;
                                        } else {
                                            throw new i("Invalid <use> element. width cannot be negative");
                                        }
                                    case 82:
                                        e1Var.f198375q = v(trim15);
                                        continue;
                                    case 83:
                                        e1Var.f198376r = v(trim15);
                                        continue;
                                }
                            } else if ("".equals(attributes.getURI(i15)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i15))) {
                                e1Var.f198374p = trim15;
                            }
                            i15++;
                        }
                        this.f198524b.a(e1Var);
                        this.f198524b = e1Var;
                        return;
                    }
                    throw new i("Invalid document. Root element must be <svg>");
                case 30:
                    M(attributes);
                    return;
                default:
                    this.f198525c = true;
                    this.f198526d = 1;
                    return;
            }
        }
    }

    public final void J(Attributes attributes) {
        if (this.f198524b != null) {
            boolean z15 = false;
            String str = FlattProperty.PROC_ALL;
            boolean z16 = true;
            for (int i15 = 0; i15 < attributes.getLength(); i15++) {
                String trim = attributes.getValue(i15).trim();
                int ordinal = g.a(attributes.getLocalName(i15)).ordinal();
                if (ordinal == 38) {
                    str = trim;
                } else if (ordinal == 77) {
                    z16 = trim.equals("text/css");
                }
            }
            if (z16) {
                b.f fVar = b.f.f198228e;
                b.d dVar = new b.d(str);
                dVar.q();
                Iterator it = ((ArrayList) b.c(dVar)).iterator();
                while (true) {
                    if (!it.hasNext()) {
                        break;
                    }
                    b.f fVar2 = (b.f) it.next();
                    if (fVar2 != b.f.f198227d) {
                        if (fVar2 == fVar) {
                            break;
                        }
                    } else {
                        break;
                    }
                }
                z15 = true;
                if (z15) {
                    this.f198530h = true;
                    return;
                }
            }
            this.f198525c = true;
            this.f198526d = 1;
            return;
        }
        throw new i("Invalid document. Root element must be <svg>");
    }

    public final void K(String str) {
        if (!this.f198525c) {
            if (this.f198527e) {
                if (this.f198529g == null) {
                    this.f198529g = new StringBuilder(str.length());
                }
                this.f198529g.append(str);
            } else if (this.f198530h) {
                if (this.f198531i == null) {
                    this.f198531i = new StringBuilder(str.length());
                }
                this.f198531i.append(str);
            } else if (this.f198524b instanceof g.y0) {
                a(str);
            }
        }
    }

    public final void L(char[] cArr, int i15, int i16) {
        if (!this.f198525c) {
            if (this.f198527e) {
                if (this.f198529g == null) {
                    this.f198529g = new StringBuilder(i16);
                }
                this.f198529g.append(cArr, i15, i16);
            } else if (this.f198530h) {
                if (this.f198531i == null) {
                    this.f198531i = new StringBuilder(i16);
                }
                this.f198531i.append(cArr, i15, i16);
            } else if (this.f198524b instanceof g.y0) {
                a(new String(cArr, i15, i16));
            }
        }
    }

    public final void M(Attributes attributes) {
        if (this.f198524b != null) {
            g.r0 f1Var = new g.f1();
            f1Var.f198422a = this.f198523a;
            f1Var.f198423b = this.f198524b;
            h(f1Var, attributes);
            g(f1Var, attributes);
            n(f1Var, attributes);
            this.f198524b.a(f1Var);
            this.f198524b = f1Var;
            return;
        }
        throw new i("Invalid document. Root element must be <svg>");
    }

    public final void a(String str) {
        g.n0 n0Var;
        g.h0 h0Var = (g.h0) this.f198524b;
        int size = h0Var.f198387i.size();
        if (size == 0) {
            n0Var = null;
        } else {
            n0Var = h0Var.f198387i.get(size - 1);
        }
        if (n0Var instanceof g.c1) {
            StringBuilder sb5 = new StringBuilder();
            g.c1 c1Var = (g.c1) n0Var;
            sb5.append(c1Var.f198307c);
            sb5.append(str);
            c1Var.f198307c = sb5.toString();
            return;
        }
        this.f198524b.a(new g.c1(str));
    }

    public final void c(String str, String str2, String str3) {
        if (this.f198525c) {
            int i15 = this.f198526d - 1;
            this.f198526d = i15;
            if (i15 == 0) {
                this.f198525c = false;
            }
        } else if ("http://www.w3.org/2000/svg".equals(str) || "".equals(str)) {
            if (str2.length() <= 0) {
                str2 = str3;
            }
            h hVar = (h) ((HashMap) h.f198547h).get(str2);
            if (hVar == null) {
                hVar = h.f198546g;
            }
            switch (hVar.ordinal()) {
                case 0:
                case 1:
                case 3:
                case 4:
                case 7:
                case 8:
                case 10:
                case 11:
                case 12:
                case 14:
                case 17:
                case 19:
                case 20:
                case 22:
                case 23:
                case 24:
                case 25:
                case 28:
                case 29:
                case 30:
                    g.j0 j0Var = this.f198524b;
                    if (j0Var != null) {
                        this.f198524b = ((g.n0) j0Var).f198423b;
                        return;
                    } else {
                        throw new i(String.format("Unbalanced end element </%s> found", str2));
                    }
                case 2:
                case 6:
                case 9:
                case 13:
                case 15:
                case 16:
                case 18:
                case 27:
                default:
                    return;
                case 5:
                case 26:
                    this.f198527e = false;
                    if (this.f198529g != null) {
                        h hVar2 = this.f198528f;
                        if (hVar2 == h.f198545f) {
                            this.f198523a.getClass();
                        } else if (hVar2 == h.f198543d) {
                            this.f198523a.getClass();
                        }
                        this.f198529g.setLength(0);
                        return;
                    }
                    return;
                case 21:
                    StringBuilder sb5 = this.f198531i;
                    if (sb5 != null) {
                        this.f198530h = false;
                        String sb6 = sb5.toString();
                        b bVar = new b(b.f.f198228e, b.u.Document);
                        g gVar = this.f198523a;
                        b.d dVar = new b.d(sb6);
                        dVar.q();
                        gVar.f198287b.b(bVar.e(dVar));
                        this.f198531i.setLength(0);
                        return;
                    }
                    return;
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:55:0x00ae, code lost:
        continue;
     */
    public final void f(Attributes attributes) {
        if (this.f198524b != null) {
            g.s sVar = new g.s();
            sVar.f198422a = this.f198523a;
            sVar.f198423b = this.f198524b;
            h(sVar, attributes);
            k(sVar, attributes);
            g(sVar, attributes);
            for (int i15 = 0; i15 < attributes.getLength(); i15++) {
                String trim = attributes.getValue(i15).trim();
                int ordinal = g.a(attributes.getLocalName(i15)).ordinal();
                if (ordinal == 25) {
                    g.p v15 = v(trim);
                    sVar.f198452r = v15;
                    if (v15.f()) {
                        throw new i("Invalid <mask> element. height cannot be negative");
                    }
                } else if (ordinal != 36) {
                    if (ordinal != 37) {
                        switch (ordinal) {
                            case 81:
                                g.p v16 = v(trim);
                                sVar.f198451q = v16;
                                if (!v16.f()) {
                                    continue;
                                } else {
                                    throw new i("Invalid <mask> element. width cannot be negative");
                                }
                            case 82:
                                v(trim);
                                continue;
                            case 83:
                                v(trim);
                                continue;
                        }
                    } else if ("objectBoundingBox".equals(trim)) {
                        sVar.f198449o = Boolean.FALSE;
                    } else if ("userSpaceOnUse".equals(trim)) {
                        sVar.f198449o = Boolean.TRUE;
                    } else {
                        throw new i("Invalid value for attribute maskUnits");
                    }
                } else if ("objectBoundingBox".equals(trim)) {
                    sVar.f198450p = Boolean.FALSE;
                } else if ("userSpaceOnUse".equals(trim)) {
                    sVar.f198450p = Boolean.TRUE;
                } else {
                    throw new i("Invalid value for attribute maskContentUnits");
                }
            }
            this.f198524b.a(sVar);
            this.f198524b = sVar;
            return;
        }
        throw new i("Invalid document. Root element must be <svg>");
    }

    public final void g(g.g0 g0Var, Attributes attributes) {
        Set<String> hashSet;
        for (int i15 = 0; i15 < attributes.getLength(); i15++) {
            String trim = attributes.getValue(i15).trim();
            int ordinal = g.a(attributes.getLocalName(i15)).ordinal();
            if (ordinal != 73) {
                switch (ordinal) {
                    case 52:
                        i iVar = new i(trim);
                        HashSet hashSet2 = new HashSet();
                        while (!iVar.f()) {
                            String l15 = iVar.l();
                            if (l15.startsWith("http://www.w3.org/TR/SVG11/feature#")) {
                                hashSet2.add(l15.substring(35));
                            } else {
                                hashSet2.add("UNSUPPORTED");
                            }
                            iVar.q();
                        }
                        g0Var.l(hashSet2);
                        continue;
                    case 53:
                        g0Var.g(trim);
                        continue;
                    case 54:
                        i iVar2 = new i(trim);
                        HashSet hashSet3 = new HashSet();
                        while (!iVar2.f()) {
                            hashSet3.add(iVar2.l());
                            iVar2.q();
                        }
                        g0Var.f(hashSet3);
                        continue;
                    case 55:
                        if (s(trim) == null) {
                            hashSet = new HashSet<>(0);
                        }
                        g0Var.i(hashSet);
                        continue;
                }
            } else {
                i iVar3 = new i(trim);
                HashSet hashSet4 = new HashSet();
                while (!iVar3.f()) {
                    String l16 = iVar3.l();
                    int indexOf = l16.indexOf(45);
                    if (indexOf != -1) {
                        l16 = l16.substring(0, indexOf);
                    }
                    hashSet4.add(new Locale(l16, "", "").getLanguage());
                    iVar3.q();
                }
                g0Var.c(hashSet4);
            }
        }
    }

    public final void h(g.l0 l0Var, Attributes attributes) {
        for (int i15 = 0; i15 < attributes.getLength(); i15++) {
            String qName = attributes.getQName(i15);
            if (qName.equals("id") || qName.equals("xml:id")) {
                l0Var.f198412c = attributes.getValue(i15).trim();
                return;
            } else if (qName.equals("xml:space")) {
                String trim = attributes.getValue(i15).trim();
                if ("default".equals(trim)) {
                    l0Var.f198413d = Boolean.FALSE;
                    return;
                } else if ("preserve".equals(trim)) {
                    l0Var.f198413d = Boolean.TRUE;
                    return;
                } else {
                    throw new i("Invalid value for \"xml:space\" attribute: " + trim);
                }
            }
        }
    }

    public final void i(g.j jVar, Attributes attributes) {
        for (int i15 = 0; i15 < attributes.getLength(); i15++) {
            String trim = attributes.getValue(i15).trim();
            int ordinal = g.a(attributes.getLocalName(i15)).ordinal();
            if (ordinal == 23) {
                jVar.f198404j = C(trim);
            } else if (ordinal != 24) {
                if (ordinal != 26) {
                    if (ordinal == 60) {
                        try {
                            jVar.f198405k = g.k.valueOf(trim);
                        } catch (IllegalArgumentException unused) {
                            throw new i("Invalid spreadMethod attribute. \"" + trim + "\" is not a valid value.");
                        }
                    }
                } else if ("".equals(attributes.getURI(i15)) || "http://www.w3.org/1999/xlink".equals(attributes.getURI(i15))) {
                    jVar.f198406l = trim;
                }
            } else if ("objectBoundingBox".equals(trim)) {
                jVar.f198403i = Boolean.FALSE;
            } else if ("userSpaceOnUse".equals(trim)) {
                jVar.f198403i = Boolean.TRUE;
            } else {
                throw new i("Invalid value for attribute gradientUnits");
            }
        }
    }

    public final void j(g.z zVar, Attributes attributes, String str) {
        for (int i15 = 0; i15 < attributes.getLength(); i15++) {
            if (g.a(attributes.getLocalName(i15)) == g.f198538e) {
                i iVar = new i(attributes.getValue(i15));
                ArrayList arrayList = new ArrayList();
                iVar.q();
                while (!iVar.f()) {
                    float i16 = iVar.i();
                    if (!Float.isNaN(i16)) {
                        iVar.p();
                        float i17 = iVar.i();
                        if (!Float.isNaN(i17)) {
                            iVar.p();
                            arrayList.add(Float.valueOf(i16));
                            arrayList.add(Float.valueOf(i17));
                        } else {
                            throw new i("Invalid <" + str + "> points attribute. There should be an even number of coordinates.");
                        }
                    } else {
                        throw new i("Invalid <" + str + "> points attribute. Non-coordinate content found in list.");
                    }
                }
                zVar.f198472o = new float[arrayList.size()];
                Iterator it = arrayList.iterator();
                int i18 = 0;
                while (it.hasNext()) {
                    zVar.f198472o[i18] = ((Float) it.next()).floatValue();
                    i18++;
                }
            }
        }
    }

    public final void k(g.l0 l0Var, Attributes attributes) {
        for (int i15 = 0; i15 < attributes.getLength(); i15++) {
            String trim = attributes.getValue(i15).trim();
            if (trim.length() != 0) {
                int ordinal = g.a(attributes.getLocalName(i15)).ordinal();
                if (ordinal == 0) {
                    b.d dVar = new b.d(trim);
                    ArrayList arrayList = null;
                    while (!dVar.f()) {
                        String l15 = dVar.l();
                        if (l15 != null) {
                            if (arrayList == null) {
                                arrayList = new ArrayList();
                            }
                            arrayList.add(l15);
                            dVar.q();
                        }
                    }
                    l0Var.f198416g = arrayList;
                } else if (ordinal != 72) {
                    if (l0Var.f198414e == null) {
                        l0Var.f198414e = new g.e0();
                    }
                    G(l0Var.f198414e, attributes.getLocalName(i15), attributes.getValue(i15).trim());
                } else {
                    b.d dVar2 = new b.d(trim.replaceAll("/\\*.*?\\*/", ""));
                    while (!dVar2.f()) {
                        dVar2.q();
                        String t15 = dVar2.t();
                        dVar2.q();
                        if (!dVar2.d(';')) {
                            if (!dVar2.d(':')) {
                                break;
                            }
                            dVar2.q();
                            String u15 = dVar2.u();
                            if (u15 != null) {
                                dVar2.q();
                                if (dVar2.f() || dVar2.d(';')) {
                                    if (l0Var.f198415f == null) {
                                        l0Var.f198415f = new g.e0();
                                    }
                                    G(l0Var.f198415f, t15, u15);
                                    dVar2.q();
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    public final void l(g.a1 a1Var, Attributes attributes) {
        for (int i15 = 0; i15 < attributes.getLength(); i15++) {
            String trim = attributes.getValue(i15).trim();
            int ordinal = g.a(attributes.getLocalName(i15)).ordinal();
            if (ordinal == 9) {
                a1Var.f198291q = w(trim);
            } else if (ordinal == 10) {
                a1Var.f198292r = w(trim);
            } else if (ordinal == 82) {
                a1Var.f198289o = w(trim);
            } else if (ordinal == 83) {
                a1Var.f198290p = w(trim);
            }
        }
    }

    public final void m(g.n nVar, Attributes attributes) {
        for (int i15 = 0; i15 < attributes.getLength(); i15++) {
            if (g.a(attributes.getLocalName(i15)) == g.f198539f) {
                nVar.m(C(attributes.getValue(i15)));
            }
        }
    }

    public final void n(g.r0 r0Var, Attributes attributes) {
        for (int i15 = 0; i15 < attributes.getLength(); i15++) {
            String trim = attributes.getValue(i15).trim();
            int ordinal = g.a(attributes.getLocalName(i15)).ordinal();
            if (ordinal == 48) {
                A(r0Var, trim);
            } else if (ordinal != 80) {
                continue;
            } else {
                i iVar = new i(trim);
                iVar.q();
                float i16 = iVar.i();
                iVar.p();
                float i17 = iVar.i();
                iVar.p();
                float i18 = iVar.i();
                iVar.p();
                float i19 = iVar.i();
                if (Float.isNaN(i16) || Float.isNaN(i17) || Float.isNaN(i18) || Float.isNaN(i19)) {
                    throw new i("Invalid viewBox definition - should have four numbers");
                } else if (i18 < 0.0f) {
                    throw new i("Invalid viewBox. width cannot be negative");
                } else if (i19 >= 0.0f) {
                    r0Var.f198448p = new g.b(i16, i17, i18, i19);
                } else {
                    throw new i("Invalid viewBox. height cannot be negative");
                }
            }
        }
    }
}