package d;

import i.C0508A;
import i.C0517J;
import i.U;
import i.b0;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.regex.Pattern;

/* JADX INFO: renamed from: d.g, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public class C0427g implements InterfaceC0423c {

    /* JADX INFO: renamed from: H, reason: collision with root package name */
    private static ConcurrentMap f3685H = new ConcurrentHashMap(128, 0.75f, 1);

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final String f3686b;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private B[] f3687g;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    private boolean f3688r;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    private b0 f3689x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    private g.i f3690y;

    /* JADX INFO: renamed from: d.g$A */
    static class A extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final Pattern f3691f;

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

        public A(String str, boolean z2, String str2, boolean z3) {
            super(str, z2);
            this.f3691f = Pattern.compile(str2);
            this.f3692g = z3;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            Object objB = b(c0427g, obj, obj3);
            if (objB == null) {
                return false;
            }
            boolean zMatches = this.f3691f.matcher(objB.toString()).matches();
            return this.f3692g ? !zMatches : zMatches;
        }
    }

    /* JADX INFO: renamed from: d.g$B */
    interface B {
        Object a(C0427g c0427g, Object obj, Object obj2);
    }

    /* JADX INFO: renamed from: d.g$C */
    static class C implements B {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public static final C f3693a = new C();

        C() {
        }

        @Override // d.C0427g.B
        /* JADX INFO: renamed from: b, reason: merged with bridge method [inline-methods] */
        public Integer a(C0427g c0427g, Object obj, Object obj2) {
            return Integer.valueOf(c0427g.h(obj2));
        }
    }

    /* JADX INFO: renamed from: d.g$D */
    static class D extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final String[] f3694f;

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

        public D(String str, boolean z2, String[] strArr, boolean z3) {
            super(str, z2);
            this.f3694f = strArr;
            this.f3695g = z3;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            Object objB = b(c0427g, obj, obj3);
            for (String str : this.f3694f) {
                if (str == objB) {
                    return !this.f3695g;
                }
                if (str != null && str.equals(objB)) {
                    return !this.f3695g;
                }
            }
            return this.f3695g;
        }
    }

    /* JADX INFO: renamed from: d.g$E */
    static class E extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final String f3696f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private final u f3697g;

        public E(String str, boolean z2, String str2, u uVar) {
            super(str, z2);
            this.f3696f = str2;
            this.f3697g = uVar;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            Object objB = b(c0427g, obj, obj3);
            u uVar = this.f3697g;
            if (uVar == u.EQ) {
                return this.f3696f.equals(objB);
            }
            if (uVar == u.NE) {
                return !this.f3696f.equals(objB);
            }
            if (objB == null) {
                return false;
            }
            int iCompareTo = this.f3696f.compareTo(objB.toString());
            u uVar2 = this.f3697g;
            return uVar2 == u.GE ? iCompareTo <= 0 : uVar2 == u.GT ? iCompareTo < 0 : uVar2 == u.LE ? iCompareTo >= 0 : uVar2 == u.LT && iCompareTo > 0;
        }
    }

    /* JADX INFO: renamed from: d.g$F */
    static class F implements B {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public static final F f3698a = new F();

        F() {
        }

        @Override // d.C0427g.B
        /* JADX INFO: renamed from: b, reason: merged with bridge method [inline-methods] */
        public String a(C0427g c0427g, Object obj, Object obj2) {
            return obj2 == null ? "null" : obj2 instanceof Collection ? "array" : obj2 instanceof Number ? "number" : obj2 instanceof Boolean ? "boolean" : ((obj2 instanceof String) || (obj2 instanceof UUID) || (obj2 instanceof Enum)) ? "string" : "object";
        }
    }

    /* JADX INFO: renamed from: d.g$G */
    static class G extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final Object f3699f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private boolean f3700g;

        public G(String str, boolean z2, Object obj, boolean z3) {
            super(str, z2);
            this.f3700g = true;
            if (obj == null) {
                throw new IllegalArgumentException("value is null");
            }
            this.f3699f = obj;
            this.f3700g = z3;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            boolean zEquals = this.f3699f.equals(b(c0427g, obj, obj3));
            return !this.f3700g ? !zEquals : zEquals;
        }
    }

    /* JADX INFO: renamed from: d.g$H */
    static class H implements B {

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public static final H f3701b = new H(false);

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public static final H f3702c = new H(true);

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private boolean f3703a;

        private H(boolean z2) {
            this.f3703a = z2;
        }

        @Override // d.C0427g.B
        public Object a(C0427g c0427g, Object obj, Object obj2) {
            if (!this.f3703a) {
                return c0427g.l(obj2);
            }
            ArrayList arrayList = new ArrayList();
            c0427g.d(obj2, arrayList);
            return arrayList;
        }
    }

    /* JADX INFO: renamed from: d.g$a, reason: case insensitive filesystem */
    static /* synthetic */ class C0428a {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        static final /* synthetic */ int[] f3704a;

        static {
            int[] iArr = new int[u.values().length];
            f3704a = iArr;
            try {
                iArr[u.EQ.ordinal()] = 1;
            } catch (NoSuchFieldError unused) {
            }
            try {
                f3704a[u.NE.ordinal()] = 2;
            } catch (NoSuchFieldError unused2) {
            }
            try {
                f3704a[u.GE.ordinal()] = 3;
            } catch (NoSuchFieldError unused3) {
            }
            try {
                f3704a[u.GT.ordinal()] = 4;
            } catch (NoSuchFieldError unused4) {
            }
            try {
                f3704a[u.LE.ordinal()] = 5;
            } catch (NoSuchFieldError unused5) {
            }
            try {
                f3704a[u.LT.ordinal()] = 6;
            } catch (NoSuchFieldError unused6) {
            }
        }
    }

    /* JADX INFO: renamed from: d.g$b, reason: case insensitive filesystem */
    static class C0429b implements B {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private final int f3705a;

        public C0429b(int i2) {
            this.f3705a = i2;
        }

        @Override // d.C0427g.B
        public Object a(C0427g c0427g, Object obj, Object obj2) {
            return c0427g.i(obj2, this.f3705a);
        }
    }

    /* JADX INFO: renamed from: d.g$c, reason: case insensitive filesystem */
    static class C0430c extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final double f3706f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private final u f3707g;

        public C0430c(String str, boolean z2, double d2, u uVar) {
            super(str, z2);
            this.f3706f = d2;
            this.f3707g = uVar;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            Object objB = b(c0427g, obj, obj3);
            if (objB == null || !(objB instanceof Number)) {
                return false;
            }
            double dDoubleValue = ((Number) objB).doubleValue();
            switch (C0428a.f3704a[this.f3707g.ordinal()]) {
                case 1:
                    if (dDoubleValue == this.f3706f) {
                    }
                    break;
                case 2:
                    if (dDoubleValue != this.f3706f) {
                    }
                    break;
                case 3:
                    if (dDoubleValue >= this.f3706f) {
                    }
                    break;
                case 4:
                    if (dDoubleValue > this.f3706f) {
                    }
                    break;
                case 5:
                    if (dDoubleValue <= this.f3706f) {
                    }
                    break;
                case 6:
                    if (dDoubleValue < this.f3706f) {
                    }
                    break;
            }
            return false;
        }
    }

    /* JADX INFO: renamed from: d.g$d, reason: case insensitive filesystem */
    interface InterfaceC0431d {
        boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3);
    }

    /* JADX INFO: renamed from: d.g$e, reason: case insensitive filesystem */
    static class C0432e implements InterfaceC0431d {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private boolean f3708a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private List f3709b;

        public C0432e(InterfaceC0431d interfaceC0431d, InterfaceC0431d interfaceC0431d2, boolean z2) {
            ArrayList arrayList = new ArrayList(2);
            this.f3709b = arrayList;
            arrayList.add(interfaceC0431d);
            this.f3709b.add(interfaceC0431d2);
            this.f3708a = z2;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            if (this.f3708a) {
                Iterator it = this.f3709b.iterator();
                while (it.hasNext()) {
                    if (!((InterfaceC0431d) it.next()).a(c0427g, obj, obj2, obj3)) {
                        return false;
                    }
                }
                return true;
            }
            Iterator it2 = this.f3709b.iterator();
            while (it2.hasNext()) {
                if (((InterfaceC0431d) it2.next()).a(c0427g, obj, obj2, obj3)) {
                    return true;
                }
            }
            return false;
        }
    }

    /* JADX INFO: renamed from: d.g$f, reason: case insensitive filesystem */
    public static class C0433f implements B {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private final InterfaceC0431d f3710a;

        public C0433f(InterfaceC0431d interfaceC0431d) {
            this.f3710a = interfaceC0431d;
        }

        @Override // d.C0427g.B
        public Object a(C0427g c0427g, Object obj, Object obj2) {
            if (obj2 == null) {
                return null;
            }
            C0422b c0422b = new C0422b();
            if (!(obj2 instanceof Iterable)) {
                if (this.f3710a.a(c0427g, obj, obj2, obj2)) {
                    return obj2;
                }
                return null;
            }
            for (Object obj3 : (Iterable) obj2) {
                if (this.f3710a.a(c0427g, obj, obj2, obj3)) {
                    c0422b.add(obj3);
                }
            }
            return c0422b;
        }
    }

    /* JADX INFO: renamed from: d.g$g, reason: collision with other inner class name */
    static class C0068g implements B {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public static final C0068g f3711a = new C0068g();

        C0068g() {
        }

        private static Object b(Object obj) {
            if (obj == null) {
                return null;
            }
            if (obj instanceof Float) {
                return Double.valueOf(Math.floor(((Float) obj).floatValue()));
            }
            if (obj instanceof Double) {
                return Double.valueOf(Math.floor(((Double) obj).doubleValue()));
            }
            if (obj instanceof BigDecimal) {
                return ((BigDecimal) obj).setScale(0, RoundingMode.FLOOR);
            }
            if ((obj instanceof Byte) || (obj instanceof Short) || (obj instanceof Integer) || (obj instanceof Long) || (obj instanceof BigInteger)) {
                return obj;
            }
            throw new UnsupportedOperationException();
        }

        @Override // d.C0427g.B
        public Object a(C0427g c0427g, Object obj, Object obj2) {
            if (!(obj2 instanceof C0422b)) {
                return b(obj2);
            }
            C0422b c0422b = (C0422b) ((C0422b) obj2).clone();
            for (int i2 = 0; i2 < c0422b.size(); i2++) {
                Object obj3 = c0422b.get(i2);
                Object objB = b(obj3);
                if (objB != obj3) {
                    c0422b.set(i2, objB);
                }
            }
            return c0422b;
        }
    }

    /* JADX INFO: renamed from: d.g$h, reason: case insensitive filesystem */
    static class C0434h extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final long f3712f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private final long f3713g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        private final boolean f3714h;

        public C0434h(String str, boolean z2, long j2, long j3, boolean z3) {
            super(str, z2);
            this.f3712f = j2;
            this.f3713g = j3;
            this.f3714h = z3;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            Object objB = b(c0427g, obj, obj3);
            if (objB == null) {
                return false;
            }
            if (objB instanceof Number) {
                long jC0 = l.l.C0((Number) objB);
                if (jC0 >= this.f3712f && jC0 <= this.f3713g) {
                    return !this.f3714h;
                }
            }
            return this.f3714h;
        }
    }

    /* JADX INFO: renamed from: d.g$i */
    static class i extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final long[] f3715f;

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

        public i(String str, boolean z2, long[] jArr, boolean z3) {
            super(str, z2);
            this.f3715f = jArr;
            this.f3716g = z3;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            Object objB = b(c0427g, obj, obj3);
            if (objB == null) {
                return false;
            }
            if (objB instanceof Number) {
                long jC0 = l.l.C0((Number) objB);
                for (long j2 : this.f3715f) {
                    if (j2 == jC0) {
                        return !this.f3716g;
                    }
                }
            }
            return this.f3716g;
        }
    }

    /* JADX INFO: renamed from: d.g$j */
    static class j extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final Long[] f3717f;

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

        public j(String str, boolean z2, Long[] lArr, boolean z3) {
            super(str, z2);
            this.f3717f = lArr;
            this.f3718g = z3;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            Object objB = b(c0427g, obj, obj3);
            int i2 = 0;
            if (objB == null) {
                Long[] lArr = this.f3717f;
                int length = lArr.length;
                while (i2 < length) {
                    if (lArr[i2] == null) {
                        return !this.f3718g;
                    }
                    i2++;
                }
                return this.f3718g;
            }
            if (objB instanceof Number) {
                long jC0 = l.l.C0((Number) objB);
                Long[] lArr2 = this.f3717f;
                int length2 = lArr2.length;
                while (i2 < length2) {
                    Long l2 = lArr2[i2];
                    if (l2 != null && l2.longValue() == jC0) {
                        return !this.f3718g;
                    }
                    i2++;
                }
            }
            return this.f3718g;
        }
    }

    /* JADX INFO: renamed from: d.g$k */
    static class k extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final long f3719f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private final u f3720g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        private BigDecimal f3721h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        private Float f3722i;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        private Double f3723j;

        public k(String str, boolean z2, long j2, u uVar) {
            super(str, z2);
            this.f3719f = j2;
            this.f3720g = uVar;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            Object objB = b(c0427g, obj, obj3);
            if (objB == null || !(objB instanceof Number)) {
                return false;
            }
            if (objB instanceof BigDecimal) {
                if (this.f3721h == null) {
                    this.f3721h = BigDecimal.valueOf(this.f3719f);
                }
                int iCompareTo = this.f3721h.compareTo((BigDecimal) objB);
                switch (C0428a.f3704a[this.f3720g.ordinal()]) {
                    case 1:
                        if (iCompareTo == 0) {
                        }
                        break;
                    case 2:
                        if (iCompareTo != 0) {
                        }
                        break;
                    case 3:
                        if (iCompareTo <= 0) {
                        }
                        break;
                    case 4:
                        if (iCompareTo < 0) {
                        }
                        break;
                    case 5:
                        if (iCompareTo >= 0) {
                        }
                        break;
                    case 6:
                        if (iCompareTo > 0) {
                        }
                        break;
                }
                return false;
            }
            if (objB instanceof Float) {
                if (this.f3722i == null) {
                    this.f3722i = Float.valueOf(this.f3719f);
                }
                int iCompareTo2 = this.f3722i.compareTo((Float) objB);
                switch (C0428a.f3704a[this.f3720g.ordinal()]) {
                    case 1:
                        if (iCompareTo2 == 0) {
                        }
                        break;
                    case 2:
                        if (iCompareTo2 != 0) {
                        }
                        break;
                    case 3:
                        if (iCompareTo2 <= 0) {
                        }
                        break;
                    case 4:
                        if (iCompareTo2 < 0) {
                        }
                        break;
                    case 5:
                        if (iCompareTo2 >= 0) {
                        }
                        break;
                    case 6:
                        if (iCompareTo2 > 0) {
                        }
                        break;
                }
                return false;
            }
            if (!(objB instanceof Double)) {
                long jC0 = l.l.C0((Number) objB);
                switch (C0428a.f3704a[this.f3720g.ordinal()]) {
                    case 1:
                        if (jC0 == this.f3719f) {
                        }
                        break;
                    case 2:
                        if (jC0 != this.f3719f) {
                        }
                        break;
                    case 3:
                        if (jC0 >= this.f3719f) {
                        }
                        break;
                    case 4:
                        if (jC0 > this.f3719f) {
                        }
                        break;
                    case 5:
                        if (jC0 <= this.f3719f) {
                        }
                        break;
                    case 6:
                        if (jC0 < this.f3719f) {
                        }
                        break;
                }
                return false;
            }
            if (this.f3723j == null) {
                this.f3723j = Double.valueOf(this.f3719f);
            }
            int iCompareTo3 = this.f3723j.compareTo((Double) objB);
            switch (C0428a.f3704a[this.f3720g.ordinal()]) {
                case 1:
                    if (iCompareTo3 == 0) {
                    }
                    break;
                case 2:
                    if (iCompareTo3 != 0) {
                    }
                    break;
                case 3:
                    if (iCompareTo3 <= 0) {
                    }
                    break;
                case 4:
                    if (iCompareTo3 < 0) {
                    }
                    break;
                case 5:
                    if (iCompareTo3 >= 0) {
                    }
                    break;
                case 6:
                    if (iCompareTo3 > 0) {
                    }
                    break;
            }
            return false;
        }
    }

    /* JADX INFO: renamed from: d.g$l */
    static class l {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private static final Pattern f3724f = Pattern.compile("'\\s*,\\s*'");

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

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private int f3726b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private char f3727c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        private int f3728d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        private boolean f3729e;

        public l(String str) {
            this.f3725a = str;
            i();
        }

        static boolean g(char c2) {
            return c2 == '-' || c2 == '+' || (c2 >= '0' && c2 <= '9');
        }

        void a(char c2) {
            if (this.f3727c == ' ') {
                i();
            }
            if (this.f3727c == c2) {
                if (h()) {
                    return;
                }
                i();
            } else {
                throw new C0435h("expect '" + c2 + ", but '" + this.f3727c + "'");
            }
        }

        B c(String str) {
            int length = str.length();
            char cCharAt = str.charAt(0);
            int i2 = length - 1;
            char cCharAt2 = str.charAt(i2);
            int iIndexOf = str.indexOf(44);
            if (str.length() > 2 && cCharAt == '\'' && cCharAt2 == '\'') {
                String strSubstring = str.substring(1, i2);
                return (iIndexOf == -1 || !f3724f.matcher(str).find()) ? new w(strSubstring, false) : new r(strSubstring.split("'\\s*,\\s*'"));
            }
            int iIndexOf2 = str.indexOf(58);
            if (iIndexOf == -1 && iIndexOf2 == -1) {
                if (l.l.u0(str)) {
                    try {
                        return new C0429b(Integer.parseInt(str));
                    } catch (NumberFormatException unused) {
                        return new w(str, false);
                    }
                }
                if (str.charAt(0) == '\"' && str.charAt(str.length() - 1) == '\"') {
                    str = str.substring(1, str.length() - 1);
                }
                return new w(str, false);
            }
            if (iIndexOf != -1) {
                String[] strArrSplit = str.split(",");
                int[] iArr = new int[strArrSplit.length];
                for (int i3 = 0; i3 < strArrSplit.length; i3++) {
                    iArr[i3] = Integer.parseInt(strArrSplit[i3]);
                }
                return new q(iArr);
            }
            if (iIndexOf2 == -1) {
                throw new UnsupportedOperationException();
            }
            String[] strArrSplit2 = str.split(":");
            int length2 = strArrSplit2.length;
            int[] iArr2 = new int[length2];
            for (int i4 = 0; i4 < strArrSplit2.length; i4++) {
                String str2 = strArrSplit2[i4];
                if (str2.length() != 0) {
                    iArr2[i4] = Integer.parseInt(str2);
                } else {
                    if (i4 != 0) {
                        throw new UnsupportedOperationException();
                    }
                    iArr2[i4] = 0;
                }
            }
            int i5 = iArr2[0];
            int i6 = length2 > 1 ? iArr2[1] : -1;
            int i7 = length2 == 3 ? iArr2[2] : 1;
            if (i6 < 0 || i6 >= i5) {
                if (i7 > 0) {
                    return new x(i5, i6, i7);
                }
                throw new UnsupportedOperationException("step must greater than zero : " + i7);
            }
            throw new UnsupportedOperationException("end must greater than or equals start. start " + i5 + ",  end " + i6);
        }

        public B[] d() {
            String str = this.f3725a;
            if (str == null || str.length() == 0) {
                throw new IllegalArgumentException();
            }
            B[] bArr = new B[8];
            while (true) {
                B bP = p();
                if (bP == null) {
                    break;
                }
                if (bP instanceof w) {
                    w wVar = (w) bP;
                    if (wVar.f3748c || !wVar.f3746a.equals("*")) {
                    }
                }
                int i2 = this.f3728d;
                if (i2 == bArr.length) {
                    B[] bArr2 = new B[(i2 * 3) / 2];
                    System.arraycopy(bArr, 0, bArr2, 0, i2);
                    bArr = bArr2;
                }
                int i3 = this.f3728d;
                this.f3728d = i3 + 1;
                bArr[i3] = bP;
            }
            int i4 = this.f3728d;
            if (i4 == bArr.length) {
                return bArr;
            }
            B[] bArr3 = new B[i4];
            System.arraycopy(bArr, 0, bArr3, 0, i4);
            return bArr3;
        }

        InterfaceC0431d e(InterfaceC0431d interfaceC0431d) {
            char c2 = this.f3727c;
            boolean z2 = true;
            boolean z3 = c2 == '&';
            if ((c2 != '&' || f() != '&') && (this.f3727c != '|' || f() != '|')) {
                return interfaceC0431d;
            }
            i();
            i();
            if (this.f3727c == '(') {
                i();
            } else {
                z2 = false;
            }
            while (this.f3727c == ' ') {
                i();
            }
            C0432e c0432e = new C0432e(interfaceC0431d, (InterfaceC0431d) k(false), z3);
            if (z2 && this.f3727c == ')') {
                i();
            }
            return c0432e;
        }

        char f() {
            return this.f3725a.charAt(this.f3726b);
        }

        boolean h() {
            return this.f3726b >= this.f3725a.length();
        }

        void i() {
            String str = this.f3725a;
            int i2 = this.f3726b;
            this.f3726b = i2 + 1;
            this.f3727c = str.charAt(i2);
        }

        B j(boolean z2) {
            Object objK = k(z2);
            return objK instanceof B ? (B) objK : new C0433f((InterfaceC0431d) objK);
        }

        /* JADX WARN: Removed duplicated region for block: B:49:0x0096  */
        /* JADX WARN: Removed duplicated region for block: B:66:0x00d8  */
        /* JADX WARN: Removed duplicated region for block: B:79:0x0119  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
            To view partially-correct add '--show-bad-code' argument
        */
        java.lang.Object k(boolean r27) {
            /*
                Method dump skipped, instruction units count: 1811
                To view this dump add '--comments-level debug' option
            */
            throw new UnsupportedOperationException("Method not decompiled: d.C0427g.l.k(boolean):java.lang.Object");
        }

        protected double l(long j2) {
            int i2 = this.f3726b - 1;
            i();
            while (true) {
                char c2 = this.f3727c;
                if (c2 < '0' || c2 > '9') {
                    break;
                }
                i();
            }
            return Double.parseDouble(this.f3725a.substring(i2, this.f3726b - 1)) + j2;
        }

        protected long m() {
            int i2 = this.f3726b - 1;
            char c2 = this.f3727c;
            if (c2 == '+' || c2 == '-') {
                i();
            }
            while (true) {
                char c3 = this.f3727c;
                if (c3 < '0' || c3 > '9') {
                    break;
                }
                i();
            }
            return Long.parseLong(this.f3725a.substring(i2, this.f3726b - 1));
        }

        String n() {
            s();
            char c2 = this.f3727c;
            if (c2 != '\\' && !Character.isJavaIdentifierStart(c2)) {
                throw new C0435h("illeal jsonpath syntax. " + this.f3725a);
            }
            StringBuilder sb = new StringBuilder();
            while (!h()) {
                char c3 = this.f3727c;
                if (c3 == '\\') {
                    i();
                    sb.append(this.f3727c);
                    if (h()) {
                        return sb.toString();
                    }
                    i();
                } else {
                    if (!Character.isJavaIdentifierPart(c3)) {
                        break;
                    }
                    sb.append(this.f3727c);
                    i();
                }
            }
            if (h() && Character.isJavaIdentifierPart(this.f3727c)) {
                sb.append(this.f3727c);
            }
            return sb.toString();
        }

        protected u o() {
            u uVar;
            char c2 = this.f3727c;
            if (c2 == '=') {
                i();
                char c3 = this.f3727c;
                if (c3 == '~') {
                    i();
                    uVar = u.REG_MATCH;
                } else if (c3 == '=') {
                    i();
                    uVar = u.EQ;
                } else {
                    uVar = u.EQ;
                }
            } else if (c2 == '!') {
                i();
                a('=');
                uVar = u.NE;
            } else if (c2 == '<') {
                i();
                if (this.f3727c == '=') {
                    i();
                    uVar = u.LE;
                } else {
                    uVar = u.LT;
                }
            } else if (c2 == '>') {
                i();
                if (this.f3727c == '=') {
                    i();
                    uVar = u.GE;
                } else {
                    uVar = u.GT;
                }
            } else {
                uVar = null;
            }
            if (uVar != null) {
                return uVar;
            }
            String strN = n();
            if ("not".equalsIgnoreCase(strN)) {
                s();
                String strN2 = n();
                if ("like".equalsIgnoreCase(strN2)) {
                    return u.NOT_LIKE;
                }
                if ("rlike".equalsIgnoreCase(strN2)) {
                    return u.NOT_RLIKE;
                }
                if ("in".equalsIgnoreCase(strN2)) {
                    return u.NOT_IN;
                }
                if ("between".equalsIgnoreCase(strN2)) {
                    return u.NOT_BETWEEN;
                }
                throw new UnsupportedOperationException();
            }
            if ("nin".equalsIgnoreCase(strN)) {
                return u.NOT_IN;
            }
            if ("like".equalsIgnoreCase(strN)) {
                return u.LIKE;
            }
            if ("rlike".equalsIgnoreCase(strN)) {
                return u.RLIKE;
            }
            if ("in".equalsIgnoreCase(strN)) {
                return u.IN;
            }
            if ("between".equalsIgnoreCase(strN)) {
                return u.BETWEEN;
            }
            throw new UnsupportedOperationException();
        }

        B p() {
            boolean z2 = true;
            if (this.f3728d == 0 && this.f3725a.length() == 1) {
                if (g(this.f3727c)) {
                    return new C0429b(this.f3727c - '0');
                }
                char c2 = this.f3727c;
                if ((c2 >= 'a' && c2 <= 'z') || (c2 >= 'A' && c2 <= 'Z')) {
                    return new w(Character.toString(c2), false);
                }
            }
            while (!h()) {
                s();
                char c3 = this.f3727c;
                if (c3 != '$') {
                    if (c3 != '.' && c3 != '/') {
                        if (c3 == '[') {
                            return j(true);
                        }
                        if (this.f3728d == 0) {
                            return new w(n(), false);
                        }
                        if (c3 == '?') {
                            return new C0433f((InterfaceC0431d) k(false));
                        }
                        throw new C0435h("not support jsonpath : " + this.f3725a);
                    }
                    i();
                    if (c3 == '.' && this.f3727c == '.') {
                        i();
                        int length = this.f3725a.length();
                        int i2 = this.f3726b;
                        if (length > i2 + 3 && this.f3727c == '[' && this.f3725a.charAt(i2) == '*' && this.f3725a.charAt(this.f3726b + 1) == ']' && this.f3725a.charAt(this.f3726b + 2) == '.') {
                            i();
                            i();
                            i();
                            i();
                        }
                    } else {
                        z2 = false;
                    }
                    char c4 = this.f3727c;
                    if (c4 == '*') {
                        if (!h()) {
                            i();
                        }
                        return z2 ? H.f3702c : H.f3701b;
                    }
                    if (g(c4)) {
                        return j(false);
                    }
                    String strN = n();
                    if (this.f3727c != '(') {
                        return new w(strN, z2);
                    }
                    i();
                    if (this.f3727c != ')') {
                        throw new C0435h("not support jsonpath : " + this.f3725a);
                    }
                    if (!h()) {
                        i();
                    }
                    if ("size".equals(strN) || "length".equals(strN)) {
                        return C.f3693a;
                    }
                    if ("max".equals(strN)) {
                        return o.f3736a;
                    }
                    if ("min".equals(strN)) {
                        return p.f3737a;
                    }
                    if ("keySet".equals(strN)) {
                        return m.f3730a;
                    }
                    if ("type".equals(strN)) {
                        return F.f3698a;
                    }
                    if ("floor".equals(strN)) {
                        return C0068g.f3711a;
                    }
                    throw new C0435h("not support jsonpath : " + this.f3725a);
                }
                i();
                s();
                if (this.f3727c == '?') {
                    return new C0433f((InterfaceC0431d) k(false));
                }
            }
            return null;
        }

        String q() {
            char c2 = this.f3727c;
            i();
            int i2 = this.f3726b - 1;
            while (this.f3727c != c2 && !h()) {
                i();
            }
            String strSubstring = this.f3725a.substring(i2, h() ? this.f3726b : this.f3726b - 1);
            a(c2);
            return strSubstring;
        }

        protected Object r() {
            s();
            if (g(this.f3727c)) {
                return Long.valueOf(m());
            }
            char c2 = this.f3727c;
            if (c2 == '\"' || c2 == '\'') {
                return q();
            }
            if (c2 != 'n') {
                throw new UnsupportedOperationException();
            }
            if ("null".equals(n())) {
                return null;
            }
            throw new C0435h(this.f3725a);
        }

        public final void s() {
            while (true) {
                char c2 = this.f3727c;
                if (c2 > ' ') {
                    return;
                }
                if (c2 != ' ' && c2 != '\r' && c2 != '\n' && c2 != '\t' && c2 != '\f' && c2 != '\b') {
                    return;
                } else {
                    i();
                }
            }
        }
    }

    /* JADX INFO: renamed from: d.g$m */
    static class m implements B {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public static final m f3730a = new m();

        m() {
        }

        @Override // d.C0427g.B
        public Object a(C0427g c0427g, Object obj, Object obj2) {
            return c0427g.g(obj2);
        }
    }

    /* JADX INFO: renamed from: d.g$n */
    static class n extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final String f3731f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private final String f3732g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        private final String[] f3733h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        private final int f3734i;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        private final boolean f3735j;

        public n(String str, boolean z2, String str2, String str3, String[] strArr, boolean z3) {
            super(str, z2);
            this.f3731f = str2;
            this.f3732g = str3;
            this.f3733h = strArr;
            this.f3735j = z3;
            int length = str2 != null ? str2.length() : 0;
            length = str3 != null ? length + str3.length() : length;
            if (strArr != null) {
                for (String str4 : strArr) {
                    length += str4.length();
                }
            }
            this.f3734i = length;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            int length;
            Object objB = b(c0427g, obj, obj3);
            if (objB == null) {
                return false;
            }
            String string = objB.toString();
            if (string.length() < this.f3734i) {
                return this.f3735j;
            }
            String str = this.f3731f;
            if (str == null) {
                length = 0;
            } else {
                if (!string.startsWith(str)) {
                    return this.f3735j;
                }
                length = this.f3731f.length();
            }
            String[] strArr = this.f3733h;
            if (strArr != null) {
                for (String str2 : strArr) {
                    int iIndexOf = string.indexOf(str2, length);
                    if (iIndexOf == -1) {
                        return this.f3735j;
                    }
                    length = iIndexOf + str2.length();
                }
            }
            String str3 = this.f3732g;
            return (str3 == null || string.endsWith(str3)) ? !this.f3735j : this.f3735j;
        }
    }

    /* JADX INFO: renamed from: d.g$o */
    static class o implements B {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public static final o f3736a = new o();

        o() {
        }

        @Override // d.C0427g.B
        public Object a(C0427g c0427g, Object obj, Object obj2) {
            if (!(obj2 instanceof Collection)) {
                throw new UnsupportedOperationException();
            }
            Object obj3 = null;
            for (Object obj4 : (Collection) obj2) {
                if (obj4 != null && (obj3 == null || C0427g.a(obj3, obj4) < 0)) {
                    obj3 = obj4;
                }
            }
            return obj3;
        }
    }

    /* JADX INFO: renamed from: d.g$p */
    static class p implements B {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public static final p f3737a = new p();

        p() {
        }

        @Override // d.C0427g.B
        public Object a(C0427g c0427g, Object obj, Object obj2) {
            if (!(obj2 instanceof Collection)) {
                throw new UnsupportedOperationException();
            }
            Object obj3 = null;
            for (Object obj4 : (Collection) obj2) {
                if (obj4 != null && (obj3 == null || C0427g.a(obj3, obj4) > 0)) {
                    obj3 = obj4;
                }
            }
            return obj3;
        }
    }

    /* JADX INFO: renamed from: d.g$q */
    static class q implements B {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private final int[] f3738a;

        public q(int[] iArr) {
            this.f3738a = iArr;
        }

        @Override // d.C0427g.B
        public Object a(C0427g c0427g, Object obj, Object obj2) {
            C0422b c0422b = new C0422b(this.f3738a.length);
            int i2 = 0;
            while (true) {
                int[] iArr = this.f3738a;
                if (i2 >= iArr.length) {
                    return c0422b;
                }
                c0422b.add(c0427g.i(obj2, iArr[i2]));
                i2++;
            }
        }
    }

    /* JADX INFO: renamed from: d.g$r */
    static class r implements B {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private final String[] f3739a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private final long[] f3740b;

        public r(String[] strArr) {
            this.f3739a = strArr;
            this.f3740b = new long[strArr.length];
            int i2 = 0;
            while (true) {
                long[] jArr = this.f3740b;
                if (i2 >= jArr.length) {
                    return;
                }
                jArr[i2] = l.l.I(strArr[i2]);
                i2++;
            }
        }

        @Override // d.C0427g.B
        public Object a(C0427g c0427g, Object obj, Object obj2) {
            ArrayList arrayList = new ArrayList(this.f3739a.length);
            int i2 = 0;
            while (true) {
                String[] strArr = this.f3739a;
                if (i2 >= strArr.length) {
                    return arrayList;
                }
                arrayList.add(c0427g.k(obj2, strArr[i2], this.f3740b[i2]));
                i2++;
            }
        }
    }

    /* JADX INFO: renamed from: d.g$s */
    static class s extends v {
        public s(String str, boolean z2) {
            super(str, z2);
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            return c0427g.k(obj3, this.f3742a, this.f3743b) != null;
        }
    }

    /* JADX INFO: renamed from: d.g$t */
    static class t extends v {
        public t(String str, boolean z2) {
            super(str, z2);
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            return b(c0427g, obj, obj3) == null;
        }
    }

    /* JADX INFO: renamed from: d.g$u */
    enum u {
        EQ,
        NE,
        GT,
        GE,
        LT,
        LE,
        LIKE,
        NOT_LIKE,
        RLIKE,
        NOT_RLIKE,
        IN,
        NOT_IN,
        BETWEEN,
        NOT_BETWEEN,
        And,
        Or,
        REG_MATCH
    }

    /* JADX INFO: renamed from: d.g$v */
    static abstract class v implements InterfaceC0431d {

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        static long f3741e = l.l.I("type");

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

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        protected final long f3743b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        protected final boolean f3744c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        protected B f3745d;

        protected v(String str, boolean z2) {
            this.f3742a = str;
            long jI = l.l.I(str);
            this.f3743b = jI;
            this.f3744c = z2;
            if (z2) {
                if (jI == f3741e) {
                    this.f3745d = F.f3698a;
                } else {
                    if (jI == 5614464919154503228L) {
                        this.f3745d = C.f3693a;
                        return;
                    }
                    throw new C0435h("unsupported funciton : " + str);
                }
            }
        }

        protected Object b(C0427g c0427g, Object obj, Object obj2) {
            B b2 = this.f3745d;
            return b2 != null ? b2.a(c0427g, obj, obj2) : c0427g.k(obj2, this.f3742a, this.f3743b);
        }
    }

    /* JADX INFO: renamed from: d.g$w */
    static class w implements B {

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

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        private final long f3747b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private final boolean f3748c;

        public w(String str, boolean z2) {
            this.f3746a = str;
            this.f3747b = l.l.I(str);
            this.f3748c = z2;
        }

        @Override // d.C0427g.B
        public Object a(C0427g c0427g, Object obj, Object obj2) {
            if (!this.f3748c) {
                return c0427g.k(obj2, this.f3746a, this.f3747b);
            }
            ArrayList arrayList = new ArrayList();
            c0427g.e(obj2, this.f3746a, arrayList);
            return arrayList;
        }
    }

    /* JADX INFO: renamed from: d.g$x */
    static class x implements B {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        private final int f3749a;

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

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        private final int f3751c;

        public x(int i2, int i3, int i4) {
            this.f3749a = i2;
            this.f3750b = i3;
            this.f3751c = i4;
        }

        @Override // d.C0427g.B
        public Object a(C0427g c0427g, Object obj, Object obj2) {
            int iIntValue = C.f3693a.a(c0427g, obj, obj2).intValue();
            int i2 = this.f3749a;
            if (i2 < 0) {
                i2 += iIntValue;
            }
            int i3 = this.f3750b;
            if (i3 < 0) {
                i3 += iIntValue;
            }
            int i4 = ((i3 - i2) / this.f3751c) + 1;
            if (i4 == -1) {
                return null;
            }
            ArrayList arrayList = new ArrayList(i4);
            while (i2 <= i3 && i2 < iIntValue) {
                arrayList.add(c0427g.i(obj2, i2));
                i2 += this.f3751c;
            }
            return arrayList;
        }
    }

    /* JADX INFO: renamed from: d.g$y */
    static class y extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final B f3752f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private final u f3753g;

        public y(String str, boolean z2, B b2, u uVar) {
            super(str, z2);
            this.f3752f = b2;
            this.f3753g = uVar;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            Object objB = b(c0427g, obj, obj3);
            if (objB == null || !(objB instanceof Number)) {
                return false;
            }
            Object objA = this.f3752f.a(c0427g, obj, obj);
            if ((objA instanceof Integer) || (objA instanceof Long) || (objA instanceof Short) || (objA instanceof Byte)) {
                long jC0 = l.l.C0((Number) objA);
                if ((objB instanceof Integer) || (objB instanceof Long) || (objB instanceof Short) || (objB instanceof Byte)) {
                    long jC02 = l.l.C0((Number) objB);
                    switch (C0428a.f3704a[this.f3753g.ordinal()]) {
                        case 1:
                            return jC02 == jC0;
                        case 2:
                            return jC02 != jC0;
                        case 3:
                            return jC02 >= jC0;
                        case 4:
                            return jC02 > jC0;
                        case 5:
                            return jC02 <= jC0;
                        case 6:
                            return jC02 < jC0;
                    }
                }
                if (objB instanceof BigDecimal) {
                    int iCompareTo = BigDecimal.valueOf(jC0).compareTo((BigDecimal) objB);
                    switch (C0428a.f3704a[this.f3753g.ordinal()]) {
                        case 1:
                            return iCompareTo == 0;
                        case 2:
                            return iCompareTo != 0;
                        case 3:
                            return iCompareTo <= 0;
                        case 4:
                            return iCompareTo < 0;
                        case 5:
                            return iCompareTo >= 0;
                        case 6:
                            return iCompareTo > 0;
                        default:
                            return false;
                    }
                }
            }
            throw new UnsupportedOperationException();
        }
    }

    /* JADX INFO: renamed from: d.g$z */
    static class z extends v {

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        private final Pattern f3754f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        private final u f3755g;

        public z(String str, boolean z2, Pattern pattern, u uVar) {
            super(str, z2);
            this.f3754f = pattern;
            this.f3755g = uVar;
        }

        @Override // d.C0427g.InterfaceC0431d
        public boolean a(C0427g c0427g, Object obj, Object obj2, Object obj3) {
            Object objB = b(c0427g, obj, obj3);
            if (objB == null) {
                return false;
            }
            return this.f3754f.matcher(objB.toString()).matches();
        }
    }

    public C0427g(String str) {
        this(str, b0.g(), g.i.r());
    }

    static int a(Object obj, Object obj2) {
        Object d2;
        Object f2;
        if (obj.getClass() == obj2.getClass()) {
            return ((Comparable) obj).compareTo(obj2);
        }
        Class<?> cls = obj.getClass();
        Class<?> cls2 = obj2.getClass();
        if (cls == BigDecimal.class) {
            if (cls2 == Integer.class) {
                f2 = new BigDecimal(((Integer) obj2).intValue());
            } else if (cls2 == Long.class) {
                f2 = new BigDecimal(((Long) obj2).longValue());
            } else if (cls2 == Float.class) {
                f2 = new BigDecimal(((Float) obj2).floatValue());
            } else if (cls2 == Double.class) {
                f2 = new BigDecimal(((Double) obj2).doubleValue());
            }
            obj2 = f2;
        } else if (cls == Long.class) {
            if (cls2 == Integer.class) {
                f2 = new Long(((Integer) obj2).intValue());
                obj2 = f2;
            } else {
                if (cls2 == BigDecimal.class) {
                    d2 = new BigDecimal(((Long) obj).longValue());
                } else if (cls2 == Float.class) {
                    d2 = new Float(((Long) obj).longValue());
                } else if (cls2 == Double.class) {
                    d2 = new Double(((Long) obj).longValue());
                }
                obj = d2;
            }
        } else if (cls == Integer.class) {
            if (cls2 == Long.class) {
                d2 = new Long(((Integer) obj).intValue());
            } else if (cls2 == BigDecimal.class) {
                d2 = new BigDecimal(((Integer) obj).intValue());
            } else if (cls2 == Float.class) {
                d2 = new Float(((Integer) obj).intValue());
            } else if (cls2 == Double.class) {
                d2 = new Double(((Integer) obj).intValue());
            }
            obj = d2;
        } else if (cls == Double.class) {
            if (cls2 == Integer.class) {
                f2 = new Double(((Integer) obj2).intValue());
            } else if (cls2 == Long.class) {
                f2 = new Double(((Long) obj2).longValue());
            } else if (cls2 == Float.class) {
                f2 = new Double(((Float) obj2).floatValue());
            }
            obj2 = f2;
        } else if (cls == Float.class) {
            if (cls2 == Integer.class) {
                f2 = new Float(((Integer) obj2).intValue());
            } else if (cls2 == Long.class) {
                f2 = new Float(((Long) obj2).longValue());
            } else if (cls2 == Double.class) {
                d2 = new Double(((Float) obj).floatValue());
                obj = d2;
            }
            obj2 = f2;
        }
        return ((Comparable) obj).compareTo(obj2);
    }

    public static C0427g c(String str) {
        if (str == null) {
            throw new C0435h("jsonpath can not be null");
        }
        C0427g c0427g = (C0427g) f3685H.get(str);
        if (c0427g != null) {
            return c0427g;
        }
        C0427g c0427g2 = new C0427g(str);
        if (f3685H.size() >= 1024) {
            return c0427g2;
        }
        f3685H.putIfAbsent(str, c0427g2);
        return (C0427g) f3685H.get(str);
    }

    protected static boolean n(Class cls) {
        return cls == Byte.class || cls == Short.class || cls == Integer.class || cls == Long.class;
    }

    @Override // d.InterfaceC0423c
    public String b() {
        return AbstractC0421a.n(this.f3686b);
    }

    protected void d(Object obj, List list) {
        Collection collectionM;
        Class<?> cls = obj.getClass();
        C0517J c0517jJ = j(cls);
        if (c0517jJ != null) {
            try {
                collectionM = c0517jJ.m(obj);
            } catch (Exception e2) {
                throw new C0435h("jsonpath error, path " + this.f3686b, e2);
            }
        } else {
            collectionM = obj instanceof Map ? ((Map) obj).values() : obj instanceof Collection ? (Collection) obj : null;
        }
        if (collectionM == null) {
            throw new UnsupportedOperationException(cls.getName());
        }
        for (Object obj2 : collectionM) {
            if (obj2 == null || g.i.u(obj2.getClass())) {
                list.add(obj2);
            } else {
                d(obj2, list);
            }
        }
    }

    protected void e(Object obj, String str, List list) {
        if (obj == null) {
            return;
        }
        if (obj instanceof Map) {
            for (Map.Entry entry : ((Map) obj).entrySet()) {
                Object value = entry.getValue();
                if (str.equals(entry.getKey())) {
                    if (value instanceof Collection) {
                        list.addAll((Collection) value);
                    } else {
                        list.add(value);
                    }
                } else if (value != null && !g.i.u(value.getClass())) {
                    e(value, str, list);
                }
            }
            return;
        }
        if (obj instanceof Collection) {
            for (Object obj2 : (Collection) obj) {
                if (!g.i.u(obj2.getClass())) {
                    e(obj2, str, list);
                }
            }
            return;
        }
        C0517J c0517jJ = j(obj.getClass());
        if (c0517jJ == null) {
            if (obj instanceof List) {
                List list2 = (List) obj;
                for (int i2 = 0; i2 < list2.size(); i2++) {
                    e(list2.get(i2), str, list);
                }
                return;
            }
            return;
        }
        try {
            C0508A c0508aK = c0517jJ.k(str);
            if (c0508aK == null) {
                Iterator it = c0517jJ.m(obj).iterator();
                while (it.hasNext()) {
                    e(it.next(), str, list);
                }
                return;
            }
            try {
                try {
                    list.add(c0508aK.c(obj));
                } catch (IllegalAccessException e2) {
                    throw new C0424d("getFieldValue error." + str, e2);
                }
            } catch (InvocationTargetException e3) {
                throw new C0424d("getFieldValue error." + str, e3);
            }
        } catch (Exception e4) {
            throw new C0435h("jsonpath error, path " + this.f3686b + ", segement " + str, e4);
        }
    }

    public Object f(Object obj) {
        if (obj == null) {
            return null;
        }
        m();
        int i2 = 0;
        Object objA = obj;
        while (true) {
            B[] bArr = this.f3687g;
            if (i2 >= bArr.length) {
                return objA;
            }
            objA = bArr[i2].a(this, obj, objA);
            i2++;
        }
    }

    Set g(Object obj) {
        C0517J c0517jJ;
        if (obj == null) {
            return null;
        }
        if (obj instanceof Map) {
            return ((Map) obj).keySet();
        }
        if ((obj instanceof Collection) || (obj instanceof Object[]) || obj.getClass().isArray() || (c0517jJ = j(obj.getClass())) == null) {
            return null;
        }
        try {
            return c0517jJ.i(obj);
        } catch (Exception e2) {
            throw new C0435h("evalKeySet error : " + this.f3686b, e2);
        }
    }

    int h(Object obj) {
        if (obj == null) {
            return -1;
        }
        if (obj instanceof Collection) {
            return ((Collection) obj).size();
        }
        if (obj instanceof Object[]) {
            return ((Object[]) obj).length;
        }
        if (obj.getClass().isArray()) {
            return Array.getLength(obj);
        }
        if (obj instanceof Map) {
            Iterator it = ((Map) obj).values().iterator();
            int i2 = 0;
            while (it.hasNext()) {
                if (it.next() != null) {
                    i2++;
                }
            }
            return i2;
        }
        C0517J c0517jJ = j(obj.getClass());
        if (c0517jJ == null) {
            return -1;
        }
        try {
            return c0517jJ.o(obj);
        } catch (Exception e2) {
            throw new C0435h("evalSize error : " + this.f3686b, e2);
        }
    }

    protected Object i(Object obj, int i2) {
        if (obj == null) {
            return null;
        }
        if (obj instanceof List) {
            List list = (List) obj;
            if (i2 >= 0) {
                if (i2 < list.size()) {
                    return list.get(i2);
                }
                return null;
            }
            if (Math.abs(i2) <= list.size()) {
                return list.get(list.size() + i2);
            }
            return null;
        }
        if (obj.getClass().isArray()) {
            int length = Array.getLength(obj);
            if (i2 >= 0) {
                if (i2 < length) {
                    return Array.get(obj, i2);
                }
                return null;
            }
            if (Math.abs(i2) <= length) {
                return Array.get(obj, length + i2);
            }
            return null;
        }
        if (obj instanceof Map) {
            Map map = (Map) obj;
            Object obj2 = map.get(Integer.valueOf(i2));
            return obj2 == null ? map.get(Integer.toString(i2)) : obj2;
        }
        if (!(obj instanceof Collection)) {
            if (i2 == 0) {
                return obj;
            }
            throw new UnsupportedOperationException();
        }
        int i3 = 0;
        for (Object obj3 : (Collection) obj) {
            if (i3 == i2) {
                return obj3;
            }
            i3++;
        }
        return null;
    }

    protected C0517J j(Class cls) {
        U uH = this.f3689x.h(cls);
        if (uH instanceof C0517J) {
            return (C0517J) uH;
        }
        return null;
    }

    protected Object k(Object obj, String str, long j2) {
        C0422b c0422b = null;
        if (obj == null) {
            return null;
        }
        if (obj instanceof String) {
            try {
                obj = AbstractC0421a.h((String) obj);
            } catch (Exception unused) {
            }
        }
        Object obj2 = obj;
        if (obj2 instanceof Map) {
            Map map = (Map) obj2;
            Object obj3 = map.get(str);
            return obj3 == null ? (5614464919154503228L == j2 || -1580386065683472715L == j2) ? Integer.valueOf(map.size()) : obj3 : obj3;
        }
        C0517J c0517jJ = j(obj2.getClass());
        if (c0517jJ != null) {
            try {
                return c0517jJ.l(obj2, str, j2, false);
            } catch (Exception e2) {
                throw new C0435h("jsonpath error, path " + this.f3686b + ", segement " + str, e2);
            }
        }
        int i2 = 0;
        if (obj2 instanceof List) {
            List list = (List) obj2;
            if (5614464919154503228L == j2 || -1580386065683472715L == j2) {
                return Integer.valueOf(list.size());
            }
            while (i2 < list.size()) {
                Object obj4 = list.get(i2);
                if (obj4 == list) {
                    if (c0422b == null) {
                        c0422b = new C0422b(list.size());
                    }
                    c0422b.add(obj4);
                } else {
                    Object objK = k(obj4, str, j2);
                    if (objK instanceof Collection) {
                        Collection collection = (Collection) objK;
                        if (c0422b == null) {
                            c0422b = new C0422b(list.size());
                        }
                        c0422b.addAll(collection);
                    } else if (objK != null) {
                        if (c0422b == null) {
                            c0422b = new C0422b(list.size());
                        }
                        c0422b.add(objK);
                    }
                }
                i2++;
            }
            return c0422b == null ? Collections.emptyList() : c0422b;
        }
        if (obj2 instanceof Object[]) {
            Object[] objArr = (Object[]) obj2;
            if (5614464919154503228L == j2 || -1580386065683472715L == j2) {
                return Integer.valueOf(objArr.length);
            }
            C0422b c0422b2 = new C0422b(objArr.length);
            while (i2 < objArr.length) {
                Object[] objArr2 = objArr[i2];
                if (objArr2 == objArr) {
                    c0422b2.add(objArr2);
                } else {
                    Object objK2 = k(objArr2, str, j2);
                    if (objK2 instanceof Collection) {
                        c0422b2.addAll((Collection) objK2);
                    } else if (objK2 != null) {
                        c0422b2.add(objK2);
                    }
                }
                i2++;
            }
            return c0422b2;
        }
        if (obj2 instanceof Enum) {
            Enum r8 = (Enum) obj2;
            if (-4270347329889690746L == j2) {
                return r8.name();
            }
            if (-1014497654951707614L == j2) {
                return Integer.valueOf(r8.ordinal());
            }
        }
        if (obj2 instanceof Calendar) {
            Calendar calendar = (Calendar) obj2;
            if (8963398325558730460L == j2) {
                return Integer.valueOf(calendar.get(1));
            }
            if (-811277319855450459L == j2) {
                return Integer.valueOf(calendar.get(2));
            }
            if (-3851359326990528739L == j2) {
                return Integer.valueOf(calendar.get(5));
            }
            if (4647432019745535567L == j2) {
                return Integer.valueOf(calendar.get(11));
            }
            if (6607618197526598121L == j2) {
                return Integer.valueOf(calendar.get(12));
            }
            if (-6586085717218287427L == j2) {
                return Integer.valueOf(calendar.get(13));
            }
        }
        return null;
    }

    protected Collection l(Object obj) {
        if (obj == null) {
            return null;
        }
        C0517J c0517jJ = j(obj.getClass());
        if (c0517jJ == null) {
            if (obj instanceof Map) {
                return ((Map) obj).values();
            }
            if (obj instanceof Collection) {
                return (Collection) obj;
            }
            throw new UnsupportedOperationException();
        }
        try {
            return c0517jJ.m(obj);
        } catch (Exception e2) {
            throw new C0435h("jsonpath error, path " + this.f3686b, e2);
        }
    }

    protected void m() {
        if (this.f3687g != null) {
            return;
        }
        if ("*".equals(this.f3686b)) {
            this.f3687g = new B[]{H.f3701b};
            return;
        }
        l lVar = new l(this.f3686b);
        this.f3687g = lVar.d();
        this.f3688r = lVar.f3729e;
    }

    public boolean o() {
        m();
        int i2 = 0;
        while (true) {
            B[] bArr = this.f3687g;
            if (i2 >= bArr.length) {
                return true;
            }
            Class<?> cls = bArr[i2].getClass();
            if (cls != C0429b.class && cls != w.class) {
                return false;
            }
            i2++;
        }
    }

    public C0427g(String str, b0 b0Var, g.i iVar) {
        if (str == null || str.length() == 0) {
            throw new C0435h("json-path can not be null or empty");
        }
        this.f3686b = str;
        this.f3689x = b0Var;
        this.f3690y = iVar;
    }
}
