package h.b.p.a0;

import h.b.m.k;
import java.util.Arrays;

/* JADX INFO: compiled from: JsonPath.kt */
/* JADX INFO: loaded from: classes.dex */
@g.i
public final class o {
    public Object[] a = new Object[8];

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int[] f4521b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f4522c;

    /* JADX INFO: compiled from: JsonPath.kt */
    @g.i
    public static final class a {
        public static final a a = new a();
    }

    public o() {
        int[] iArr = new int[8];
        for (int i2 = 0; i2 < 8; i2++) {
            iArr[i2] = -1;
        }
        this.f4521b = iArr;
        this.f4522c = -1;
    }

    public final String a() {
        StringBuilder sbB = d.b.a.a.a.B("$");
        int i2 = this.f4522c + 1;
        for (int i3 = 0; i3 < i2; i3++) {
            Object obj = this.a[i3];
            if (obj instanceof h.b.m.e) {
                h.b.m.e eVar = (h.b.m.e) obj;
                if (!g.h0.c.l.a(eVar.e(), k.b.a)) {
                    int i4 = this.f4521b[i3];
                    if (i4 >= 0) {
                        sbB.append(".");
                        sbB.append(eVar.g(i4));
                    }
                } else if (this.f4521b[i3] != -1) {
                    sbB.append("[");
                    sbB.append(this.f4521b[i3]);
                    sbB.append("]");
                }
            } else if (obj != a.a) {
                sbB.append("[");
                sbB.append("'");
                sbB.append(obj);
                sbB.append("'");
                sbB.append("]");
            }
        }
        String string = sbB.toString();
        g.h0.c.l.e(string, "StringBuilder().apply(builderAction).toString()");
        return string;
    }

    public final void b() {
        int i2 = this.f4522c * 2;
        Object[] objArrCopyOf = Arrays.copyOf(this.a, i2);
        g.h0.c.l.e(objArrCopyOf, "copyOf(this, newSize)");
        this.a = objArrCopyOf;
        int[] iArrCopyOf = Arrays.copyOf(this.f4521b, i2);
        g.h0.c.l.e(iArrCopyOf, "copyOf(this, newSize)");
        this.f4521b = iArrCopyOf;
    }

    public String toString() {
        return a();
    }
}
