package okhttp3;

import g.a.a.a.a;
import io.netty.handler.codec.rtsp.RtspHeaders;
import java.util.Date;
import java.util.regex.Pattern;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.o;
import kotlin.text.j;
import okhttp3.n0.http.c;
import org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement;

/* JADX INFO: renamed from: y.o, reason: from Kotlin metadata */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\t\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\f\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u000b\u0018\u0000 &2\u00020\u0001:\u0002%&BO\b\u0002\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003\u0012\u0006\u0010\u0005\u001a\u00020\u0006\u0012\u0006\u0010\u0007\u001a\u00020\u0003\u0012\u0006\u0010\b\u001a\u00020\u0003\u0012\u0006\u0010\t\u001a\u00020\n\u0012\u0006\u0010\u000b\u001a\u00020\n\u0012\u0006\u0010\f\u001a\u00020\n\u0012\u0006\u0010\r\u001a\u00020\n¢\u0006\u0002\u0010\u000eJ\r\u0010\u0007\u001a\u00020\u0003H\u0007¢\u0006\u0002\b\u0012J\u0013\u0010\u0013\u001a\u00020\n2\b\u0010\u0014\u001a\u0004\u0018\u00010\u0001H\u0096\u0002J\r\u0010\u0005\u001a\u00020\u0006H\u0007¢\u0006\u0002\b\u0015J\b\u0010\u0016\u001a\u00020\u0017H\u0017J\r\u0010\r\u001a\u00020\nH\u0007¢\u0006\u0002\b\u0018J\r\u0010\u000b\u001a\u00020\nH\u0007¢\u0006\u0002\b\u0019J\u000e\u0010\u001a\u001a\u00020\n2\u0006\u0010\u001b\u001a\u00020\u001cJ\r\u0010\u0002\u001a\u00020\u0003H\u0007¢\u0006\u0002\b\u001dJ\r\u0010\b\u001a\u00020\u0003H\u0007¢\u0006\u0002\b\u001eJ\r\u0010\f\u001a\u00020\nH\u0007¢\u0006\u0002\b\u001fJ\r\u0010\t\u001a\u00020\nH\u0007¢\u0006\u0002\b J\b\u0010!\u001a\u00020\u0003H\u0016J\u0015\u0010!\u001a\u00020\u00032\u0006\u0010\"\u001a\u00020\nH\u0000¢\u0006\u0002\b#J\r\u0010\u0004\u001a\u00020\u0003H\u0007¢\u0006\u0002\b$R\u0013\u0010\u0007\u001a\u00020\u00038\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\u000fR\u0013\u0010\u0005\u001a\u00020\u00068\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0010R\u0013\u0010\r\u001a\u00020\n8\u0007¢\u0006\b\n\u0000\u001a\u0004\b\r\u0010\u0011R\u0013\u0010\u000b\u001a\u00020\n8\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u000b\u0010\u0011R\u0013\u0010\u0002\u001a\u00020\u00038\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0002\u0010\u000fR\u0013\u0010\b\u001a\u00020\u00038\u0007¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\u000fR\u0013\u0010\f\u001a\u00020\n8\u0007¢\u0006\b\n\u0000\u001a\u0004\b\f\u0010\u0011R\u0013\u0010\t\u001a\u00020\n8\u0007¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\u0011R\u0013\u0010\u0004\u001a\u00020\u00038\u0007¢\u0006\b\n\u0000\u001a\u0004\b\u0004\u0010\u000f¨\u0006'"}, d2 = {"Lokhttp3/Cookie;", "", "name", "", "value", "expiresAt", "", "domain", "path", "secure", "", "httpOnly", "persistent", "hostOnly", "(Ljava/lang/String;Ljava/lang/String;JLjava/lang/String;Ljava/lang/String;ZZZZ)V", "()Ljava/lang/String;", "()J", "()Z", "-deprecated_domain", "equals", "other", "-deprecated_expiresAt", "hashCode", "", "-deprecated_hostOnly", "-deprecated_httpOnly", "matches", RtspHeaders.Values.URL, "Lokhttp3/HttpUrl;", "-deprecated_name", "-deprecated_path", "-deprecated_persistent", "-deprecated_secure", "toString", "forObsoleteRfc2965", "toString$okhttp", "-deprecated_value", "Builder", "Companion", "okhttp"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class Cookie {
    public static final Cookie a = null;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final Pattern f10064b = Pattern.compile("(\\d{2,4})[^\\d]*");

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final Pattern f10065c = Pattern.compile("(?i)(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec).*");

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public static final Pattern f10066d = Pattern.compile("(\\d{1,2})[^\\d]*");

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final Pattern f10067e = Pattern.compile("(\\d{1,2}):(\\d{1,2}):(\\d{1,2})[^\\d]*");

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final String f10068f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final String f10069g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public final long f10070h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public final String f10071i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final String f10072j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    public final boolean f10073k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    public final boolean f10074l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final boolean f10075m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    public final boolean f10076n;

    public Cookie(String str, String str2, long j2, String str3, String str4, boolean z2, boolean z3, boolean z4, boolean z5, DefaultConstructorMarker defaultConstructorMarker) {
        this.f10068f = str;
        this.f10069g = str2;
        this.f10070h = j2;
        this.f10071i = str3;
        this.f10072j = str4;
        this.f10073k = z2;
        this.f10074l = z3;
        this.f10075m = z4;
        this.f10076n = z5;
    }

    public static final int a(String str, int i2, int i3, boolean z2) {
        while (i2 < i3) {
            int i4 = i2 + 1;
            char cCharAt = str.charAt(i2);
            boolean z3 = true;
            if ((cCharAt >= ' ' || cCharAt == '\t') && cCharAt < 127) {
                if (!(cCharAt <= '9' && '0' <= cCharAt)) {
                    if (!(cCharAt <= 'z' && 'a' <= cCharAt)) {
                        if (!(cCharAt <= 'Z' && 'A' <= cCharAt) && cCharAt != ':') {
                            z3 = false;
                        }
                    }
                }
            }
            if (z3 == (!z2)) {
                return i2;
            }
            i2 = i4;
        }
        return i3;
    }

    /* JADX WARN: Removed duplicated region for block: B:18:0x00a7  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public static final long b(java.lang.String r12, int r13, int r14) {
        /*
            Method dump skipped, instruction units count: 395
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: okhttp3.Cookie.b(java.lang.String, int, int):long");
    }

    public static final long c(String str) {
        try {
            long j2 = Long.parseLong(str);
            if (j2 <= 0) {
                return Long.MIN_VALUE;
            }
            return j2;
        } catch (NumberFormatException e2) {
            o.f("-?\\d+", "pattern");
            Pattern patternCompile = Pattern.compile("-?\\d+");
            o.e(patternCompile, "compile(pattern)");
            o.f(patternCompile, "nativePattern");
            o.f(str, "input");
            if (patternCompile.matcher(str).matches()) {
                return j.M(str, "-", false, 2) ? Long.MIN_VALUE : Long.MAX_VALUE;
            }
            throw e2;
        }
    }

    public boolean equals(Object other) {
        if (other instanceof Cookie) {
            Cookie cookie = (Cookie) other;
            if (o.a(cookie.f10068f, this.f10068f) && o.a(cookie.f10069g, this.f10069g) && cookie.f10070h == this.f10070h && o.a(cookie.f10071i, this.f10071i) && o.a(cookie.f10072j, this.f10072j) && cookie.f10073k == this.f10073k && cookie.f10074l == this.f10074l && cookie.f10075m == this.f10075m && cookie.f10076n == this.f10076n) {
                return true;
            }
        }
        return false;
    }

    @IgnoreJRERequirement
    public int hashCode() {
        return Boolean.hashCode(this.f10076n) + ((Boolean.hashCode(this.f10075m) + ((Boolean.hashCode(this.f10074l) + ((Boolean.hashCode(this.f10073k) + a.H(this.f10072j, a.H(this.f10071i, (Long.hashCode(this.f10070h) + a.H(this.f10069g, a.H(this.f10068f, 527, 31), 31)) * 31, 31), 31)) * 31)) * 31)) * 31);
    }

    public String toString() {
        String str;
        StringBuilder sb = new StringBuilder();
        sb.append(this.f10068f);
        sb.append('=');
        sb.append(this.f10069g);
        if (this.f10075m) {
            if (this.f10070h == Long.MIN_VALUE) {
                str = "; max-age=0";
            } else {
                sb.append("; expires=");
                Date date = new Date(this.f10070h);
                c.a aVar = c.a;
                o.f(date, "<this>");
                str = c.a.get().format(date);
                o.e(str, "STANDARD_DATE_FORMAT.get().format(this)");
            }
            sb.append(str);
        }
        if (!this.f10076n) {
            sb.append("; domain=");
            sb.append(this.f10071i);
        }
        sb.append("; path=");
        sb.append(this.f10072j);
        if (this.f10073k) {
            sb.append("; secure");
        }
        if (this.f10074l) {
            sb.append("; httponly");
        }
        String string = sb.toString();
        o.e(string, "toString()");
        return string;
    }
}
