package o; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; import java.io.InvalidObjectException; import java.io.ObjectStreamException; import java.io.Serializable; import java.util.List; import org.threeten.bp.DateTimeException; import org.threeten.bp.OffsetDateTime; /* loaded from: classes6.dex */ public final class gsN extends gsS implements Serializable { public static final gtQ FROM = new gtQ() { // from class: o.gsN.1 @Override // o.gtQ public final gsN queryFrom(gtK gtk) { return gsN.from(gtk); } }; private static final long serialVersionUID = -6260982410461394882L; private final C15522gsr dateTime; private final gsI offset; private final AbstractC15502gsH zone; public static gsN now() { return now(AbstractC15514gsj.systemDefaultZone()); } public static gsN now(AbstractC15502gsH abstractC15502gsH) { return now(AbstractC15514gsj.system(abstractC15502gsH)); } public static gsN now(AbstractC15514gsj abstractC15514gsj) { gtG.requireNonNull(abstractC15514gsj, "clock"); return ofInstant(abstractC15514gsj.instant(), abstractC15514gsj.getZone()); } public static gsN of(C15520gsp c15520gsp, C15521gsq c15521gsq, AbstractC15502gsH abstractC15502gsH) { return of(C15522gsr.of(c15520gsp, c15521gsq), abstractC15502gsH); } public static gsN of(C15522gsr c15522gsr, AbstractC15502gsH abstractC15502gsH) { return ofLocal(c15522gsr, abstractC15502gsH, null); } public static gsN of(int i, int i2, int i3, int i4, int i5, int i6, int i7, AbstractC15502gsH abstractC15502gsH) { return ofLocal(C15522gsr.of(i, i2, i3, i4, i5, i6, i7), abstractC15502gsH, null); } public static gsN ofLocal(C15522gsr c15522gsr, AbstractC15502gsH abstractC15502gsH, gsI gsi) { gtG.requireNonNull(c15522gsr, "localDateTime"); gtG.requireNonNull(abstractC15502gsH, "zone"); if (abstractC15502gsH instanceof gsI) { return new gsN(c15522gsr, (gsI) abstractC15502gsH, abstractC15502gsH); } AbstractC15574gua rules = abstractC15502gsH.getRules(); List validOffsets = rules.getValidOffsets(c15522gsr); if (validOffsets.size() == 1) { gsi = validOffsets.get(0); } else if (validOffsets.size() == 0) { gtW transition = rules.getTransition(c15522gsr); c15522gsr = c15522gsr.plusSeconds(transition.getDuration().getSeconds()); gsi = transition.getOffsetAfter(); } else if (gsi == null || !validOffsets.contains(gsi)) { gsi = (gsI) gtG.requireNonNull(validOffsets.get(0), "offset"); } return new gsN(c15522gsr, gsi, abstractC15502gsH); } public static gsN ofInstant(C15523gss c15523gss, AbstractC15502gsH abstractC15502gsH) { gtG.requireNonNull(c15523gss, "instant"); gtG.requireNonNull(abstractC15502gsH, "zone"); return create(c15523gss.getEpochSecond(), c15523gss.getNano(), abstractC15502gsH); } public static gsN ofInstant(C15522gsr c15522gsr, gsI gsi, AbstractC15502gsH abstractC15502gsH) { gtG.requireNonNull(c15522gsr, "localDateTime"); gtG.requireNonNull(gsi, "offset"); gtG.requireNonNull(abstractC15502gsH, "zone"); return create(c15522gsr.toEpochSecond(gsi), c15522gsr.getNano(), abstractC15502gsH); } private static gsN create(long j, int i, AbstractC15502gsH abstractC15502gsH) { gsI offset = abstractC15502gsH.getRules().getOffset(C15523gss.ofEpochSecond(j, i)); return new gsN(C15522gsr.ofEpochSecond(j, i, offset), offset, abstractC15502gsH); } public static gsN ofStrict(C15522gsr c15522gsr, gsI gsi, AbstractC15502gsH abstractC15502gsH) { gtG.requireNonNull(c15522gsr, "localDateTime"); gtG.requireNonNull(gsi, "offset"); gtG.requireNonNull(abstractC15502gsH, "zone"); AbstractC15574gua rules = abstractC15502gsH.getRules(); if (!rules.isValidOffset(c15522gsr, gsi)) { gtW transition = rules.getTransition(c15522gsr); if (transition != null && transition.isGap()) { StringBuilder sb = new StringBuilder("LocalDateTime '"); sb.append(c15522gsr); sb.append("' does not exist in zone '"); sb.append(abstractC15502gsH); sb.append("' due to a gap in the local time-line, typically caused by daylight savings"); throw new DateTimeException(sb.toString()); } StringBuilder sb2 = new StringBuilder("ZoneOffset '"); sb2.append(gsi); sb2.append("' is not valid for LocalDateTime '"); sb2.append(c15522gsr); sb2.append("' in zone '"); sb2.append(abstractC15502gsH); sb2.append("'"); throw new DateTimeException(sb2.toString()); } return new gsN(c15522gsr, gsi, abstractC15502gsH); } private static gsN ofLenient(C15522gsr c15522gsr, gsI gsi, AbstractC15502gsH abstractC15502gsH) { gtG.requireNonNull(c15522gsr, "localDateTime"); gtG.requireNonNull(gsi, "offset"); gtG.requireNonNull(abstractC15502gsH, "zone"); if ((abstractC15502gsH instanceof gsI) && !gsi.equals(abstractC15502gsH)) { throw new IllegalArgumentException("ZoneId must match ZoneOffset"); } return new gsN(c15522gsr, gsi, abstractC15502gsH); } public static gsN from(gtK gtk) { if (gtk instanceof gsN) { return (gsN) gtk; } try { AbstractC15502gsH from = AbstractC15502gsH.from(gtk); if (gtk.isSupported(EnumC15534gtD.INSTANT_SECONDS)) { try { return create(gtk.getLong(EnumC15534gtD.INSTANT_SECONDS), gtk.get(EnumC15534gtD.NANO_OF_SECOND), from); } catch (DateTimeException unused) { } } return of(C15522gsr.from(gtk), from); } catch (DateTimeException unused2) { StringBuilder sb = new StringBuilder("Unable to obtain ZonedDateTime from TemporalAccessor: "); sb.append(gtk); sb.append(", type "); sb.append(gtk.getClass().getName()); throw new DateTimeException(sb.toString()); } } public static gsN parse(CharSequence charSequence) { return parse(charSequence, C15554gto.ISO_ZONED_DATE_TIME); } public static gsN parse(CharSequence charSequence, C15554gto c15554gto) { gtG.requireNonNull(c15554gto, "formatter"); return (gsN) c15554gto.parse(charSequence, FROM); } private gsN(C15522gsr c15522gsr, gsI gsi, AbstractC15502gsH abstractC15502gsH) { this.dateTime = c15522gsr; this.offset = gsi; this.zone = abstractC15502gsH; } private gsN resolveLocal(C15522gsr c15522gsr) { return ofLocal(c15522gsr, this.zone, this.offset); } private gsN resolveInstant(C15522gsr c15522gsr) { return ofInstant(c15522gsr, this.offset, this.zone); } private gsN resolveOffset(gsI gsi) { return (gsi.equals(this.offset) || !this.zone.getRules().isValidOffset(this.dateTime, gsi)) ? this : new gsN(this.dateTime, gsi, this.zone); } @Override // o.gtK public final boolean isSupported(InterfaceC15537gtP interfaceC15537gtP) { return (interfaceC15537gtP instanceof EnumC15534gtD) || (interfaceC15537gtP != null && interfaceC15537gtP.isSupportedBy(this)); } @Override // o.InterfaceC15536gtL public final boolean isSupported(InterfaceC15539gtV interfaceC15539gtV) { return interfaceC15539gtV instanceof gtH ? interfaceC15539gtV.isDateBased() || interfaceC15539gtV.isTimeBased() : interfaceC15539gtV != null && interfaceC15539gtV.isSupportedBy(this); } @Override // o.gsS, o.gtE, o.gtK public final gtT range(InterfaceC15537gtP interfaceC15537gtP) { if (interfaceC15537gtP instanceof EnumC15534gtD) { if (interfaceC15537gtP == EnumC15534gtD.INSTANT_SECONDS || interfaceC15537gtP == EnumC15534gtD.OFFSET_SECONDS) { return interfaceC15537gtP.range(); } return this.dateTime.range(interfaceC15537gtP); } return interfaceC15537gtP.rangeRefinedBy(this); } /* JADX INFO: Access modifiers changed from: package-private */ /* renamed from: o.gsN$4, reason: invalid class name */ /* loaded from: classes6.dex */ public static /* synthetic */ class AnonymousClass4 { static final int[] $SwitchMap$org$threeten$bp$temporal$ChronoField; static { int[] iArr = new int[EnumC15534gtD.values().length]; $SwitchMap$org$threeten$bp$temporal$ChronoField = iArr; try { iArr[EnumC15534gtD.INSTANT_SECONDS.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { $SwitchMap$org$threeten$bp$temporal$ChronoField[EnumC15534gtD.OFFSET_SECONDS.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } } } @Override // o.gsS, o.gtE, o.gtK public final int get(InterfaceC15537gtP interfaceC15537gtP) { if (interfaceC15537gtP instanceof EnumC15534gtD) { int i = AnonymousClass4.$SwitchMap$org$threeten$bp$temporal$ChronoField[((EnumC15534gtD) interfaceC15537gtP).ordinal()]; if (i == 1) { throw new DateTimeException("Field too large for an int: ".concat(String.valueOf(interfaceC15537gtP))); } if (i == 2) { return getOffset().getTotalSeconds(); } return this.dateTime.get(interfaceC15537gtP); } return super.get(interfaceC15537gtP); } @Override // o.gsS, o.gtK public final long getLong(InterfaceC15537gtP interfaceC15537gtP) { if (interfaceC15537gtP instanceof EnumC15534gtD) { int i = AnonymousClass4.$SwitchMap$org$threeten$bp$temporal$ChronoField[((EnumC15534gtD) interfaceC15537gtP).ordinal()]; if (i == 1) { return toEpochSecond(); } if (i == 2) { return getOffset().getTotalSeconds(); } return this.dateTime.getLong(interfaceC15537gtP); } return interfaceC15537gtP.getFrom(this); } @Override // o.gsS /* renamed from: withEarlierOffsetAtOverlap, reason: merged with bridge method [inline-methods] */ public final gsS withEarlierOffsetAtOverlap2() { gtW transition = getZone().getRules().getTransition(this.dateTime); if (transition != null && transition.isOverlap()) { gsI offsetBefore = transition.getOffsetBefore(); if (!offsetBefore.equals(this.offset)) { return new gsN(this.dateTime, offsetBefore, this.zone); } } return this; } /* JADX WARN: Multi-variable type inference failed */ /* JADX WARN: Type inference failed for: r1v0, types: [o.gsr] */ @Override // o.gsS /* renamed from: withLaterOffsetAtOverlap, reason: merged with bridge method [inline-methods] */ public final gsS withLaterOffsetAtOverlap2() { gtW transition = getZone().getRules().getTransition(toLocalDateTime()); if (transition != null) { gsI offsetAfter = transition.getOffsetAfter(); if (!offsetAfter.equals(this.offset)) { return new gsN(this.dateTime, offsetAfter, this.zone); } } return this; } @Override // o.gsS /* renamed from: withZoneSameLocal, reason: merged with bridge method [inline-methods] */ public final gsS withZoneSameLocal2(AbstractC15502gsH abstractC15502gsH) { gtG.requireNonNull(abstractC15502gsH, "zone"); return this.zone.equals(abstractC15502gsH) ? this : ofLocal(this.dateTime, abstractC15502gsH, this.offset); } @Override // o.gsS /* renamed from: withZoneSameInstant, reason: merged with bridge method [inline-methods] */ public final gsS withZoneSameInstant2(AbstractC15502gsH abstractC15502gsH) { gtG.requireNonNull(abstractC15502gsH, "zone"); return this.zone.equals(abstractC15502gsH) ? this : create(this.dateTime.toEpochSecond(this.offset), this.dateTime.getNano(), abstractC15502gsH); } public final gsN withFixedOffsetZone() { if (this.zone.equals(this.offset)) { return this; } C15522gsr c15522gsr = this.dateTime; gsI gsi = this.offset; return new gsN(c15522gsr, gsi, gsi); } public final int getYear() { return this.dateTime.getYear(); } public final int getMonthValue() { return this.dateTime.getMonthValue(); } public final EnumC15528gsx getMonth() { return this.dateTime.getMonth(); } public final int getDayOfMonth() { return this.dateTime.getDayOfMonth(); } public final int getDayOfYear() { return this.dateTime.getDayOfYear(); } public final EnumC15515gsk getDayOfWeek() { return this.dateTime.getDayOfWeek(); } public final int getHour() { return this.dateTime.getHour(); } public final int getMinute() { return this.dateTime.getMinute(); } public final int getSecond() { return this.dateTime.getSecond(); } public final int getNano() { return this.dateTime.getNano(); } @Override // o.gsS, o.AbstractC15535gtF, o.InterfaceC15536gtL public final gsN with(gtJ gtj) { if (gtj instanceof C15520gsp) { return resolveLocal(C15522gsr.of((C15520gsp) gtj, this.dateTime.toLocalTime())); } if (gtj instanceof C15521gsq) { return resolveLocal(C15522gsr.of(this.dateTime.toLocalDate(), (C15521gsq) gtj)); } if (gtj instanceof C15522gsr) { return resolveLocal((C15522gsr) gtj); } if (gtj instanceof C15523gss) { C15523gss c15523gss = (C15523gss) gtj; return create(c15523gss.getEpochSecond(), c15523gss.getNano(), this.zone); } if (gtj instanceof gsI) { return resolveOffset((gsI) gtj); } return (gsN) gtj.adjustInto(this); } @Override // o.gsS, o.InterfaceC15536gtL public final gsN with(InterfaceC15537gtP interfaceC15537gtP, long j) { if (interfaceC15537gtP instanceof EnumC15534gtD) { EnumC15534gtD enumC15534gtD = (EnumC15534gtD) interfaceC15537gtP; int i = AnonymousClass4.$SwitchMap$org$threeten$bp$temporal$ChronoField[enumC15534gtD.ordinal()]; if (i == 1) { return create(j, getNano(), this.zone); } if (i == 2) { return resolveOffset(gsI.ofTotalSeconds(enumC15534gtD.checkValidIntValue(j))); } return resolveLocal(this.dateTime.with(interfaceC15537gtP, j)); } return (gsN) interfaceC15537gtP.adjustInto(this, j); } public final gsN withYear(int i) { return resolveLocal(this.dateTime.withYear(i)); } public final gsN withMonth(int i) { return resolveLocal(this.dateTime.withMonth(i)); } public final gsN withDayOfMonth(int i) { return resolveLocal(this.dateTime.withDayOfMonth(i)); } public final gsN withDayOfYear(int i) { return resolveLocal(this.dateTime.withDayOfYear(i)); } public final gsN withHour(int i) { return resolveLocal(this.dateTime.withHour(i)); } public final gsN withMinute(int i) { return resolveLocal(this.dateTime.withMinute(i)); } public final gsN withSecond(int i) { return resolveLocal(this.dateTime.withSecond(i)); } public final gsN withNano(int i) { return resolveLocal(this.dateTime.withNano(i)); } public final gsN truncatedTo(InterfaceC15539gtV interfaceC15539gtV) { return resolveLocal(this.dateTime.truncatedTo(interfaceC15539gtV)); } @Override // o.gsS, o.AbstractC15535gtF, o.InterfaceC15536gtL public final gsN plus(gtN gtn) { return (gsN) gtn.addTo(this); } @Override // o.gsS, o.InterfaceC15536gtL public final gsN plus(long j, InterfaceC15539gtV interfaceC15539gtV) { if (interfaceC15539gtV instanceof gtH) { if (interfaceC15539gtV.isDateBased()) { return resolveLocal(this.dateTime.plus(j, interfaceC15539gtV)); } return resolveInstant(this.dateTime.plus(j, interfaceC15539gtV)); } return (gsN) interfaceC15539gtV.addTo(this, j); } public final gsN plusYears(long j) { return resolveLocal(this.dateTime.plusYears(j)); } public final gsN plusMonths(long j) { return resolveLocal(this.dateTime.plusMonths(j)); } public final gsN plusWeeks(long j) { return resolveLocal(this.dateTime.plusWeeks(j)); } public final gsN plusDays(long j) { return resolveLocal(this.dateTime.plusDays(j)); } public final gsN plusHours(long j) { return resolveInstant(this.dateTime.plusHours(j)); } public final gsN plusMinutes(long j) { return resolveInstant(this.dateTime.plusMinutes(j)); } public final gsN plusSeconds(long j) { return resolveInstant(this.dateTime.plusSeconds(j)); } public final gsN plusNanos(long j) { return resolveInstant(this.dateTime.plusNanos(j)); } @Override // o.gsS, o.AbstractC15535gtF, o.InterfaceC15536gtL public final gsN minus(gtN gtn) { return (gsN) gtn.subtractFrom(this); } @Override // o.gsS, o.AbstractC15535gtF, o.InterfaceC15536gtL public final gsN minus(long j, InterfaceC15539gtV interfaceC15539gtV) { return j == Long.MIN_VALUE ? plus(Long.MAX_VALUE, interfaceC15539gtV).plus(1L, interfaceC15539gtV) : plus(-j, interfaceC15539gtV); } public final gsN minusYears(long j) { return j == Long.MIN_VALUE ? plusYears(Long.MAX_VALUE).plusYears(1L) : plusYears(-j); } public final gsN minusMonths(long j) { return j == Long.MIN_VALUE ? plusMonths(Long.MAX_VALUE).plusMonths(1L) : plusMonths(-j); } public final gsN minusWeeks(long j) { return j == Long.MIN_VALUE ? plusWeeks(Long.MAX_VALUE).plusWeeks(1L) : plusWeeks(-j); } public final gsN minusDays(long j) { return j == Long.MIN_VALUE ? plusDays(Long.MAX_VALUE).plusDays(1L) : plusDays(-j); } public final gsN minusHours(long j) { return j == Long.MIN_VALUE ? plusHours(Long.MAX_VALUE).plusHours(1L) : plusHours(-j); } public final gsN minusMinutes(long j) { return j == Long.MIN_VALUE ? plusMinutes(Long.MAX_VALUE).plusMinutes(1L) : plusMinutes(-j); } public final gsN minusSeconds(long j) { return j == Long.MIN_VALUE ? plusSeconds(Long.MAX_VALUE).plusSeconds(1L) : plusSeconds(-j); } public final gsN minusNanos(long j) { return j == Long.MIN_VALUE ? plusNanos(Long.MAX_VALUE).plusNanos(1L) : plusNanos(-j); } @Override // o.gsS, o.gtE, o.gtK public final R query(gtQ gtq) { if (gtq == gtM.localDate()) { return (R) toLocalDate(); } return (R) super.query(gtq); } /* JADX WARN: Type inference failed for: r2v3, types: [o.gsN] */ @Override // o.InterfaceC15536gtL public final long until(InterfaceC15536gtL interfaceC15536gtL, InterfaceC15539gtV interfaceC15539gtV) { gsN from = from((gtK) interfaceC15536gtL); if (interfaceC15539gtV instanceof gtH) { ?? withZoneSameInstant2 = from.withZoneSameInstant2(this.zone); if (interfaceC15539gtV.isDateBased()) { return this.dateTime.until(withZoneSameInstant2.dateTime, interfaceC15539gtV); } return toOffsetDateTime().until(withZoneSameInstant2.toOffsetDateTime(), interfaceC15539gtV); } return interfaceC15539gtV.between(this, from); } @Override // o.gsS public final C15520gsp toLocalDate() { return this.dateTime.toLocalDate(); } @Override // o.gsS public final C15521gsq toLocalTime() { return this.dateTime.toLocalTime(); } public final OffsetDateTime toOffsetDateTime() { return OffsetDateTime.of(this.dateTime, this.offset); } @Override // o.gsS public final boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof gsN)) { return false; } gsN gsn = (gsN) obj; return this.dateTime.equals(gsn.dateTime) && this.offset.equals(gsn.offset) && this.zone.equals(gsn.zone); } @Override // o.gsS public final int hashCode() { return (this.dateTime.hashCode() ^ this.offset.hashCode()) ^ Integer.rotateLeft(this.zone.hashCode(), 3); } @Override // o.gsS public final String toString() { StringBuilder sb = new StringBuilder(); sb.append(this.dateTime.toString()); sb.append(this.offset.toString()); String obj = sb.toString(); if (this.offset == this.zone) { return obj; } StringBuilder sb2 = new StringBuilder(); sb2.append(obj); sb2.append('['); sb2.append(this.zone.toString()); sb2.append(']'); return sb2.toString(); } @Override // o.gsS public final String format(C15554gto c15554gto) { return super.format(c15554gto); } private Object writeReplace() { return new C15501gsD((byte) 6, this); } private Object readResolve() throws ObjectStreamException { throw new InvalidObjectException("Deserialization via serialization delegate"); } /* JADX INFO: Access modifiers changed from: package-private */ public final void writeExternal(DataOutput dataOutput) throws IOException { this.dateTime.writeExternal(dataOutput); this.offset.writeExternal(dataOutput); this.zone.write(dataOutput); } /* JADX INFO: Access modifiers changed from: package-private */ public static gsN readExternal(DataInput dataInput) throws IOException { return ofLenient(C15522gsr.readExternal(dataInput), gsI.readExternal(dataInput), (AbstractC15502gsH) C15501gsD.read(dataInput)); } @Override // o.gsS public final gsO toLocalDateTime() { return this.dateTime; } @Override // o.gsS public final AbstractC15502gsH getZone() { return this.zone; } @Override // o.gsS public final gsI getOffset() { return this.offset; } }