package defpackage;

import java.io.IOException;

/* JADX INFO: renamed from: ᵕᵵᵠ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C2366 implements Appendable {

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public final Appendable f9262;

    /* JADX INFO: renamed from: ᵜᵪʾ, reason: contains not printable characters */
    public boolean f9263 = true;

    public C2366(Appendable appendable) {
        this.f9262 = appendable;
    }

    @Override // java.lang.Appendable
    public final Appendable append(char c) throws IOException {
        boolean z = this.f9263;
        Appendable appendable = this.f9262;
        if (z) {
            this.f9263 = false;
            appendable.append("  ");
        }
        this.f9263 = c == '\n';
        appendable.append(c);
        return this;
    }

    @Override // java.lang.Appendable
    public final Appendable append(CharSequence charSequence) throws IOException {
        if (charSequence == null) {
            charSequence = "";
        }
        append(charSequence, 0, charSequence.length());
        return this;
    }

    @Override // java.lang.Appendable
    public final Appendable append(CharSequence charSequence, int i, int i2) throws IOException {
        if (charSequence == null) {
            charSequence = "";
        }
        boolean z = this.f9263;
        Appendable appendable = this.f9262;
        boolean z2 = false;
        if (z) {
            this.f9263 = false;
            appendable.append("  ");
        }
        if (charSequence.length() > 0 && charSequence.charAt(i2 - 1) == '\n') {
            z2 = true;
        }
        this.f9263 = z2;
        appendable.append(charSequence, i, i2);
        return this;
    }
}
