package com.revenuecat.purchases.ui.revenuecatui.helpers;

import J4.c;
import J4.e;
import androidx.compose.runtime.internal.StabilityInferred;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import java.util.function.UnaryOperator;
import kotlin.jvm.internal.n;
import kotlin.jvm.internal.o;
import n2.AbstractC2612c;
import x4.AbstractC3251q;
import x4.AbstractC3252r;
import x4.AbstractC3253s;

/* JADX INFO: loaded from: classes3.dex */
@StabilityInferred(parameters = 0)
public final class NonEmptyList<A> implements List<A>, K4.a {
    public static final int $stable = 8;
    private final List<A> all;

    /* JADX WARN: Multi-variable type inference failed */
    private NonEmptyList(List<? extends A> list) {
        this.all = list;
    }

    @Override // java.util.List
    public void add(int i6, A a6) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List
    public boolean addAll(int i6, Collection<? extends A> collection) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    public void addFirst(A a6) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    public void addLast(A a6) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List, java.util.Collection
    public void clear() {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List, java.util.Collection
    public boolean contains(Object obj) {
        return this.all.contains(obj);
    }

    @Override // java.util.List, java.util.Collection
    public boolean containsAll(Collection<? extends Object> elements) {
        o.h(elements, "elements");
        return this.all.containsAll(elements);
    }

    @Override // java.util.List, java.util.Collection
    public boolean equals(Object obj) {
        return obj instanceof NonEmptyList ? o.c(this.all, ((NonEmptyList) obj).all) : o.c(this.all, obj);
    }

    @Override // java.util.List
    public A get(int i6) {
        return this.all.get(i6);
    }

    public final /* synthetic */ Object getHead() {
        return AbstractC3251q.e0(this.all);
    }

    public int getSize() {
        return this.all.size();
    }

    @Override // java.util.List, java.util.Collection
    public int hashCode() {
        return this.all.hashCode();
    }

    @Override // java.util.List
    public int indexOf(Object obj) {
        return this.all.indexOf(obj);
    }

    @Override // java.util.List, java.util.Collection
    public /* synthetic */ boolean isEmpty() {
        return false;
    }

    @Override // java.util.List, java.util.Collection, java.lang.Iterable
    public Iterator<A> iterator() {
        return this.all.iterator();
    }

    @Override // java.util.List
    public int lastIndexOf(Object obj) {
        return this.all.lastIndexOf(obj);
    }

    @Override // java.util.List
    public ListIterator<A> listIterator() {
        return this.all.listIterator();
    }

    public final /* synthetic */ NonEmptyList map(c transform) {
        o.h(transform, "transform");
        List<A> list = this.all;
        ArrayList arrayList = new ArrayList(AbstractC3253s.G(list, 10));
        Iterator<T> it = list.iterator();
        while (it.hasNext()) {
            arrayList.add(transform.invoke(it.next()));
        }
        return new NonEmptyList(arrayList);
    }

    public final /* synthetic */ NonEmptyList mapIndexed(e transform) {
        o.h(transform, "transform");
        List<A> list = this.all;
        ArrayList arrayList = new ArrayList(AbstractC3253s.G(list, 10));
        int i6 = 0;
        for (Object obj : list) {
            int i7 = i6 + 1;
            if (i6 < 0) {
                AbstractC3252r.F();
                throw null;
            }
            arrayList.add(transform.invoke(Integer.valueOf(i6), obj));
            i6 = i7;
        }
        return new NonEmptyList(arrayList);
    }

    @Override // java.util.List
    public A remove(int i6) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List, java.util.Collection
    public boolean removeAll(Collection<? extends Object> collection) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    public A removeFirst() {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    public A removeLast() {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List
    public void replaceAll(UnaryOperator<A> unaryOperator) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List, java.util.Collection
    public boolean retainAll(Collection<? extends Object> collection) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List
    public A set(int i6, A a6) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List, java.util.Collection
    public final /* bridge */ int size() {
        return getSize();
    }

    @Override // java.util.List
    public void sort(Comparator<? super A> comparator) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List
    public List<A> subList(int i6, int i7) {
        return this.all.subList(i6, i7);
    }

    @Override // java.util.List, java.util.Collection
    public Object[] toArray() {
        return n.a(this);
    }

    public final /* synthetic */ List toList() {
        return this.all;
    }

    public String toString() {
        return Z0.o.r(new StringBuilder("NonEmptyList("), AbstractC3251q.m0(this.all, null, null, null, null, 63), ')');
    }

    @Override // java.util.List, java.util.Collection
    public boolean add(A a6) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List, java.util.Collection
    public boolean addAll(Collection<? extends A> collection) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List
    public ListIterator<A> listIterator(int i6) {
        return this.all.listIterator(i6);
    }

    @Override // java.util.List, java.util.Collection
    public boolean remove(Object obj) {
        throw new UnsupportedOperationException("Operation is not supported for read-only collection");
    }

    @Override // java.util.List, java.util.Collection
    public <T> T[] toArray(T[] array) {
        o.h(array, "array");
        return (T[]) n.b(this, array);
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public NonEmptyList(A a6, List<? extends A> tail) {
        this(AbstractC3251q.s0(tail, AbstractC2612c.q(a6)));
        o.h(tail, "tail");
    }
}
