package zb;

import com.google.zxing.BarcodeFormat;
import com.google.zxing.DecodeHintType;
import com.google.zxing.NotFoundException;
import com.google.zxing.ReaderException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public final class i extends j {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final m[] f37148b = new m[0];

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final m[] f37149a;

    public i(Map map) {
        Collection collection = map == null ? null : (Collection) map.get(DecodeHintType.f24317b);
        ArrayList arrayList = new ArrayList();
        if (collection != null) {
            if (collection.contains(BarcodeFormat.f24309h)) {
                arrayList.add(new e());
            } else if (collection.contains(BarcodeFormat.R)) {
                arrayList.add(new f(1));
            }
            if (collection.contains(BarcodeFormat.f24308g)) {
                arrayList.add(new f(0));
            }
            if (collection.contains(BarcodeFormat.S)) {
                arrayList.add(new n());
            }
        }
        if (arrayList.isEmpty()) {
            arrayList.add(new e());
            arrayList.add(new f(0));
            arrayList.add(new n());
        }
        this.f37149a = (m[]) arrayList.toArray(f37148b);
    }

    @Override // zb.j
    public final ob.f c(int i10, tb.a aVar, Map map) throws NotFoundException {
        int[] iArrN = m.n(aVar);
        for (m mVar : this.f37149a) {
            try {
                ob.f fVarL = mVar.l(i10, aVar, iArrN, map);
                BarcodeFormat barcodeFormat = fVarL.f31470d;
                BarcodeFormat barcodeFormat2 = BarcodeFormat.f24309h;
                String str = fVarL.f31467a;
                boolean z10 = barcodeFormat == barcodeFormat2 && str.charAt(0) == '0';
                Collection collection = map == null ? null : (Collection) map.get(DecodeHintType.f24317b);
                BarcodeFormat barcodeFormat3 = BarcodeFormat.R;
                boolean z11 = collection == null || collection.contains(barcodeFormat3);
                if (!z10 || !z11) {
                    return fVarL;
                }
                ob.f fVar = new ob.f(str.substring(1), fVarL.f31468b, fVarL.f31469c, barcodeFormat3);
                fVar.a(fVarL.f31471e);
                return fVar;
            } catch (ReaderException unused) {
            }
        }
        throw NotFoundException.a();
    }

    @Override // zb.j, ob.e
    public final void reset() {
        for (m mVar : this.f37149a) {
            mVar.getClass();
        }
    }
}
