package lq;

import com.fasterxml.jackson.core.JsonFactory;
import kotlin.text.z;

/* loaded from: classes3.dex */
public final class r extends a {

    /* renamed from: e, reason: collision with root package name */
    private final String f28544e;

    public r(String source) {
        kotlin.jvm.internal.t.g(source, "source");
        this.f28544e = source;
    }

    @Override // lq.a
    public int H(int i10) {
        if (i10 < D().length()) {
            return i10;
        }
        return -1;
    }

    @Override // lq.a
    public int J() {
        char charAt;
        int i10 = this.f28498a;
        if (i10 == -1) {
            return i10;
        }
        while (i10 < D().length() && ((charAt = D().charAt(i10)) == ' ' || charAt == '\n' || charAt == '\r' || charAt == '\t')) {
            i10++;
        }
        this.f28498a = i10;
        return i10;
    }

    @Override // lq.a
    public boolean M() {
        int J = J();
        if (J == D().length() || J == -1 || D().charAt(J) != ',') {
            return false;
        }
        this.f28498a++;
        return true;
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // lq.a
    /* renamed from: R, reason: merged with bridge method [inline-methods] */
    public String D() {
        return this.f28544e;
    }

    @Override // lq.a
    public boolean f() {
        int i10 = this.f28498a;
        if (i10 == -1) {
            return false;
        }
        while (i10 < D().length()) {
            char charAt = D().charAt(i10);
            if (charAt != ' ' && charAt != '\n' && charAt != '\r' && charAt != '\t') {
                this.f28498a = i10;
                return E(charAt);
            }
            i10++;
        }
        this.f28498a = i10;
        return false;
    }

    @Override // lq.a
    public String k() {
        int g02;
        n(JsonFactory.DEFAULT_QUOTE_CHAR);
        int i10 = this.f28498a;
        g02 = z.g0(D(), JsonFactory.DEFAULT_QUOTE_CHAR, i10, false, 4, null);
        if (g02 == -1) {
            s();
            z((byte) 1, false);
            throw new rm.k();
        }
        for (int i11 = i10; i11 < g02; i11++) {
            if (D().charAt(i11) == '\\') {
                return r(D(), this.f28498a, i11);
            }
        }
        this.f28498a = g02 + 1;
        String substring = D().substring(i10, g02);
        kotlin.jvm.internal.t.f(substring, "this as java.lang.String…ing(startIndex, endIndex)");
        return substring;
    }

    @Override // lq.a
    public byte l() {
        byte a10;
        String D = D();
        do {
            int i10 = this.f28498a;
            if (i10 == -1 || i10 >= D.length()) {
                return (byte) 10;
            }
            int i11 = this.f28498a;
            this.f28498a = i11 + 1;
            a10 = b.a(D.charAt(i11));
        } while (a10 == 3);
        return a10;
    }

    @Override // lq.a
    public void n(char c10) {
        if (this.f28498a == -1) {
            P(c10);
        }
        String D = D();
        while (this.f28498a < D.length()) {
            int i10 = this.f28498a;
            this.f28498a = i10 + 1;
            char charAt = D.charAt(i10);
            if (charAt != ' ' && charAt != '\n' && charAt != '\r' && charAt != '\t') {
                if (charAt == c10) {
                    return;
                } else {
                    P(c10);
                }
            }
        }
        this.f28498a = -1;
        P(c10);
    }
}
