package p421.p433.p434.p445;

import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
import p138.p176.p177.p242.p246.p251.C4303;
import p421.p433.p434.p439.p440.AbstractC6797;
import p421.p433.p434.p439.p440.C6800;
import p421.p433.p434.p442.C6822;
import p421.p433.p434.p442.C6828;
import p421.p433.p434.p444.C6837;
import p421.p433.p434.p445.AbstractC6848;

/* JADX INFO: renamed from: ޏ.ؠ.֏.ބ.ކ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C6852 extends AbstractC6843<C6853> {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public char[] f19886;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public AbstractC6797 f19887;

    /* JADX INFO: renamed from: ޏ.ؠ.֏.ބ.ކ$֏, reason: contains not printable characters */
    public static class C6853 extends AbstractC6845 {

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public String f19888;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public C6822 f19889;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public String f19890;

        public C6853(String str, C6822 c6822, String str2, Charset charset) {
            super(charset);
            this.f19888 = str;
            this.f19889 = c6822;
            this.f19890 = str2;
        }
    }

    public C6852(C6828 c6828, char[] cArr, AbstractC6848.C6849 c6849) {
        super(c6828, c6849);
        this.f19886 = cArr;
    }

    @Override // p421.p433.p434.p445.AbstractC6848
    /* JADX INFO: renamed from: ֏ */
    public long mo9990(Object obj) {
        return C4303.m7149(m9997(((C6853) obj).f19889));
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final List<C6822> m9997(final C6822 c6822) {
        boolean z = c6822.f19745;
        if (z) {
            return !z ? Collections.emptyList() : (List) this.f19872.f19780.f19746.stream().filter(new Predicate() { // from class: ދ.ހ.֏.ހ.ހ.ދ.֏
                @Override // java.util.function.Predicate
                public final boolean test(Object obj) {
                    return ((C6822) obj).f19737.startsWith(c6822.f19737);
                }
            }).collect(Collectors.toList());
        }
        return Collections.singletonList(c6822);
    }

    @Override // p421.p433.p434.p445.AbstractC6848
    /* JADX INFO: renamed from: ֏ */
    public void mo9991(Object obj, C6837 c6837) throws IOException {
        C6853 c6853 = (C6853) obj;
        try {
            C6822 c6822 = c6853.f19889;
            Charset charset = c6853.f19874;
            AbstractC6797 abstractC6797M7072 = C4303.m7072(this.f19872);
            this.f19887 = abstractC6797M7072;
            abstractC6797M7072.m9965(c6822);
            C6800 c6800 = new C6800(this.f19887, this.f19886, charset);
            try {
                for (C6822 c68222 : m9997(c6853.f19889)) {
                    String strReplaceFirst = c6853.f19890;
                    C6822 c68223 = c6853.f19889;
                    if (C4303.m7202(strReplaceFirst) && c68223.f19745) {
                        String str = strReplaceFirst.endsWith("/") ? "" : "/";
                        strReplaceFirst = c68222.f19737.replaceFirst(c68223.f19737, strReplaceFirst + str);
                    }
                    m9987(c6800, c68222, c6853.f19888, strReplaceFirst, c6837);
                }
                c6800.close();
            } finally {
            }
        } finally {
            AbstractC6797 abstractC6797 = this.f19887;
            if (abstractC6797 != null) {
                abstractC6797.close();
            }
        }
    }
}
