content: package okhttp3.internal.http;
  
  import java.text.DateFormat;
  import java.text.ParsePosition;
  import java.text.SimpleDateFormat;
  import java.util.Date;
  import java.util.Locale;
  import kotlin.Metadata;
  import kotlin.Unit;
  import kotlin.jvm.internal.Intrinsics;
  import okhttp3.internal.Util;
  
  @Metadata(bv = {1, 0, 3}, d1 = {"\u0000+\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\t\n\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\n\u001a\u000e\u0010\f\u001a\u0004\u0018\u00010\r*\u00020\u0005H\u0000\u001a\f\u0010\u000e\u001a\u00020\u0005*\u00020\rH\u0000\"\u0018\u0010\u0000\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00020\u0001X\u0004¢\u0006\u0004\n\u0002\u0010\u0003\"\u0016\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00050\u0001X\u0004¢\u0006\u0004\n\u0002\u0010\u0006\"\u000e\u0010\u0007\u001a\u00020\bXT¢\u0006\u0002\n\u0000\"\u0010\u0010\t\u001a\u00020\nX\u0004¢\u0006\u0004\n\u0002\u0010\u000b¨\u0006\u000f"}, d2 = {"BROWSER_COMPATIBLE_DATE_FORMATS", "", "Ljava/text/DateFormat;", "[Ljava/text/DateFormat;", "BROWSER_COMPATIBLE_DATE_FORMAT_STRINGS", "", "[Ljava/lang/String;", "MAX_DATE", "", "STANDARD_DATE_FORMAT", "okhttp3/internal/http/DatesKt$STANDARD_DATE_FORMAT$1", "Lokhttp3/internal/http/DatesKt$STANDARD_DATE_FORMAT$1;", "toHttpDateOrNull", "Ljava/util/Date;", "toHttpDateString", "okhttp"}, k = 2, mv = {1, 4, 0})
  /* compiled from: dates.kt */
  public final class DatesKt {
      private static final DateFormat[] BROWSER_COMPATIBLE_DATE_FORMATS;
      private static final String[] BROWSER_COMPATIBLE_DATE_FORMAT_STRINGS;
      public static final long MAX_DATE = 253402300799999L;
      private static final DatesKt$STANDARD_DATE_FORMAT$1 STANDARD_DATE_FORMAT = new DatesKt$STANDARD_DATE_FORMAT$1();
  
      static {
          String[] strArr = {"EEE, dd MMM yyyy HH:mm:ss zzz", "EEEE, dd-MMM-yy HH:mm:ss zzz", "EEE MMM d HH:mm:ss yyyy", "EEE, dd-MMM-yyyy HH:mm:ss z", "EEE, dd-MMM-yyyy HH-mm-ss z", "EEE, dd MMM yy HH:mm:ss z", "EEE dd-MMM-yyyy HH:mm:ss z", "EEE dd MMM yyyy HH:mm:ss z", "EEE dd-MMM-yyyy HH-mm-ss z", "EEE dd-MMM-yy HH:mm:ss z", "EEE dd MMM yy HH:mm:ss z", "EEE,dd-MMM-yy HH:mm:ss z", "EEE,dd-MMM-yyyy HH:mm:ss z", "EEE, dd-MM-yyyy HH:mm:ss z", "EEE MMM d yyyy HH:mm:ss z"};
          BROWSER_COMPATIBLE_DATE_FORMAT_STRINGS = strArr;
          BROWSER_COMPATIBLE_DATE_FORMATS = new DateFormat[strArr.length];
      }
  
      public static final Date toHttpDateOrNull(String $this$toHttpDateOrNull) {
          Intrinsics.checkNotNullParameter($this$toHttpDateOrNull, "$this$toHttpDateOrNull");
          if ($this$toHttpDateOrNull.length() == 0) {
              return null;
          }
          ParsePosition parsePosition = new ParsePosition(0);
          Date parse = ((DateFormat) STANDARD_DATE_FORMAT.get()).parse($this$toHttpDateOrNull, parsePosition);
          if (parsePosition.getIndex() == $this$toHttpDateOrNull.length()) {
              return parse;
          }
          String[] strArr = BROWSER_COMPATIBLE_DATE_FORMAT_STRINGS;
          synchronized (strArr) {
              int length = strArr.length;
              for (int i = 0; i < length; i++) {
                  DateFormat[] dateFormatArr = BROWSER_COMPATIBLE_DATE_FORMATS;
                  DateFormat dateFormat = dateFormatArr[i];
                  if (dateFormat == null) {
                      SimpleDateFormat simpleDateFormat = new SimpleDateFormat(BROWSER_COMPATIBLE_DATE_FORMAT_STRINGS[i], Locale.US);
                      simpleDateFormat.setTimeZone(Util.UTC);
                      dateFormat = simpleDateFormat;
                      dateFormatArr[i] = dateFormat;
                  }
                  parsePosition.setIndex(0);
                  Date parse2 = dateFormat.parse($this$toHttpDateOrNull, parsePosition);
                  if (parsePosition.getIndex() != 0) {
                      return parse2;
                  }
              }
              Unit unit = Unit.INSTANCE;
              return null;
          }
      }
  
      public static final String toHttpDateString(Date $this$toHttpDateString) {
          Intrinsics.checkNotNullParameter($this$toHttpDateString, "$this$toHttpDateString");
          String format = ((DateFormat) STANDARD_DATE_FORMAT.get()).format($this$toHttpDateString);
          Intrinsics.checkNotNullExpressionValue(format, "STANDARD_DATE_FORMAT.get().format(this)");
          return format;
      }
  }
  