package defpackage;

import android.net.Uri;
import android.text.TextUtils;
import androidx.media3.common.ParserException;
import j$.util.DesugarTimeZone;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/* renamed from: ˀᵿᵠˈ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0630 implements InterfaceC4068 {

    /* renamed from: ᵧᵾˀˈ, reason: contains not printable characters */
    public static final Pattern f3134 = Pattern.compile("(.+?)(Z|((\\+|-|−)(\\d\\d)(:?(\\d\\d))?))");

    @Override // defpackage.InterfaceC4068
    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public final Object mo2519(Uri uri, C1779 c1779) throws IOException, NumberFormatException {
        String line = new BufferedReader(new InputStreamReader(c1779, StandardCharsets.UTF_8)).readLine();
        try {
            Matcher matcher = f3134.matcher(line);
            if (!matcher.matches()) {
                throw ParserException.m357("Couldn't parse timestamp: " + line, null);
            }
            String strGroup = matcher.group(1);
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US);
            simpleDateFormat.setTimeZone(DesugarTimeZone.getTimeZone("UTC"));
            long time = simpleDateFormat.parse(strGroup).getTime();
            if (!"Z".equals(matcher.group(2))) {
                long j = "+".equals(matcher.group(4)) ? 1L : -1L;
                long j2 = Long.parseLong(matcher.group(5));
                String strGroup2 = matcher.group(7);
                time -= (((j2 * 60) + (TextUtils.isEmpty(strGroup2) ? 0L : Long.parseLong(strGroup2))) * 60000) * j;
            }
            return Long.valueOf(time);
        } catch (ParseException e) {
            throw ParserException.m357(null, e);
        }
    }
}
