package p447.p448.p450;

import kotlin.jvm.internal.DefaultConstructorMarker;
import p402.InterfaceC6540;
import p402.p411.p413.C6635;
import p402.p420.C6703;
import p447.AbstractC6894;
import p447.AbstractC6936;
import p447.C6864;
import p447.C6905;
import p447.C6926;
import p447.C6933;
import p447.EnumC6924;
import p447.InterfaceC6868;
import p447.InterfaceC6912;
import p447.p448.C6943;
import p447.p448.p452.C6964;

/* JADX INFO: renamed from: ސ.ޣ.ނ.֏, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
@InterfaceC6540
public final class C6946 implements InterfaceC6912 {

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static final C6947 f20200 = new C6947(null);

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final C6864 f20201 = null;

    /* JADX INFO: renamed from: ސ.ޣ.ނ.֏$֏, reason: contains not printable characters */
    public static final class C6947 {
        public C6947() {
        }

        public /* synthetic */ C6947(DefaultConstructorMarker defaultConstructorMarker) {
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public static final /* synthetic */ C6933 m10180(C6947 c6947, C6933 c6933) {
            if (c6947 == null) {
                throw null;
            }
            if ((c6933 != null ? c6933.f20152 : null) == null) {
                return c6933;
            }
            if (c6933 == null) {
                throw null;
            }
            C6933.C6934 c6934 = new C6933.C6934(c6933);
            c6934.f20165 = null;
            return c6934.m10133();
        }

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final boolean m10181(String str) {
            return C6703.m9905("Content-Length", str, true) || C6703.m9905("Content-Encoding", str, true) || C6703.m9905("Content-Type", str, true);
        }

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final boolean m10182(String str) {
            return (C6703.m9905("Connection", str, true) || C6703.m9905("Keep-Alive", str, true) || C6703.m9905("Proxy-Authenticate", str, true) || C6703.m9905("Proxy-Authorization", str, true) || C6703.m9905("TE", str, true) || C6703.m9905("Trailers", str, true) || C6703.m9905("Transfer-Encoding", str, true) || C6703.m9905("Upgrade", str, true)) ? false : true;
        }
    }

    @Override // p447.InterfaceC6912
    public C6933 intercept(InterfaceC6912.InterfaceC6913 interfaceC6913) {
        AbstractC6894 abstractC6894;
        if (interfaceC6913 == null) {
            C6635.m9824("chain");
            throw null;
        }
        InterfaceC6868 interfaceC6868Call = interfaceC6913.call();
        System.currentTimeMillis();
        C6926 c6926Mo10102 = interfaceC6913.mo10102();
        if (c6926Mo10102 == null) {
            C6635.m9824("request");
            throw null;
        }
        C6948 c6948 = new C6948(c6926Mo10102, null);
        if (c6948.f20203 != null && c6926Mo10102.m10116().f19922) {
            c6948 = new C6948(null, null);
        }
        C6926 c6926 = c6948.f20203;
        C6933 c6933 = c6948.f20204;
        C6964 c6964 = (C6964) (!(interfaceC6868Call instanceof C6964) ? null : interfaceC6868Call);
        if (c6964 == null || (abstractC6894 = c6964.f20262) == null) {
            abstractC6894 = AbstractC6894.f19994;
        }
        if (c6926 == null && c6933 == null) {
            C6933.C6934 c6934 = new C6933.C6934();
            c6934.m10131(interfaceC6913.mo10102());
            c6934.m10130(EnumC6924.HTTP_1_1);
            c6934.f20161 = 504;
            c6934.f20162 = "Unsatisfiable Request (only-if-cached)";
            c6934.f20165 = C6943.f20192;
            c6934.f20169 = -1L;
            c6934.f20170 = System.currentTimeMillis();
            C6933 c6933M10133 = c6934.m10133();
            if (abstractC6894 == null) {
                throw null;
            }
            if (interfaceC6868Call != null) {
                return c6933M10133;
            }
            C6635.m9824("call");
            throw null;
        }
        if (c6926 == null) {
            if (c6933 == null) {
                C6635.m9822();
                throw null;
            }
            C6933.C6934 c69342 = new C6933.C6934(c6933);
            c69342.m10132(C6947.m10180(f20200, c6933));
            C6933 c6933M101332 = c69342.m10133();
            if (abstractC6894 == null) {
                throw null;
            }
            if (interfaceC6868Call != null) {
                return c6933M101332;
            }
            C6635.m9824("call");
            throw null;
        }
        if (c6933 != null) {
            if (abstractC6894 == null) {
                throw null;
            }
            if (interfaceC6868Call == null) {
                C6635.m9824("call");
                throw null;
            }
        }
        C6933 c6933Mo10101 = interfaceC6913.mo10101(c6926);
        if (c6933 != null) {
            if (c6933Mo10101 != null && c6933Mo10101.f20149 == 304) {
                C6933.C6934 c69343 = new C6933.C6934(c6933);
                C6947 c6947 = f20200;
                C6905 c6905 = c6933.f20151;
                C6905 c69052 = c6933Mo10101.f20151;
                if (c6947 == null) {
                    throw null;
                }
                C6905.C6906 c6906 = new C6905.C6906();
                int size = c6905.size();
                for (int i = 0; i < size; i++) {
                    String strM10068 = c6905.m10068(i);
                    String strM10070 = c6905.m10070(i);
                    if ((!C6703.m9905("Warning", strM10068, true) || !C6703.m9899(strM10070, "1", false, 2)) && (c6947.m10181(strM10068) || !c6947.m10182(strM10068) || c69052.m10067(strM10068) == null)) {
                        c6906.m10074(strM10068, strM10070);
                    }
                }
                int size2 = c69052.size();
                for (int i2 = 0; i2 < size2; i2++) {
                    String strM100682 = c69052.m10068(i2);
                    if (!c6947.m10181(strM100682) && c6947.m10182(strM100682)) {
                        c6906.m10074(strM100682, c69052.m10070(i2));
                    }
                }
                c69343.m10129(c6906.m10073());
                c69343.f20169 = c6933Mo10101.f20156;
                c69343.f20170 = c6933Mo10101.f20157;
                c69343.m10132(C6947.m10180(f20200, c6933));
                C6933 c6933M10180 = C6947.m10180(f20200, c6933Mo10101);
                c69343.m10134("networkResponse", c6933M10180);
                c69343.f20166 = c6933M10180;
                c69343.m10133();
                AbstractC6936 abstractC6936 = c6933Mo10101.f20152;
                if (abstractC6936 == null) {
                    C6635.m9822();
                    throw null;
                }
                abstractC6936.close();
                C6635.m9822();
                throw null;
            }
            AbstractC6936 abstractC69362 = c6933.f20152;
            if (abstractC69362 != null) {
                C6943.m10164(abstractC69362);
            }
        }
        if (c6933Mo10101 == null) {
            C6635.m9822();
            throw null;
        }
        C6933.C6934 c69344 = new C6933.C6934(c6933Mo10101);
        c69344.m10132(C6947.m10180(f20200, c6933));
        C6933 c6933M101802 = C6947.m10180(f20200, c6933Mo10101);
        c69344.m10134("networkResponse", c6933M101802);
        c69344.f20166 = c6933M101802;
        return c69344.m10133();
    }
}
