package defpackage;

import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Path;
import android.graphics.RectF;
import com.airbnb.lottie.g;
import defpackage.u70;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.ListIterator;

/* JADX INFO: loaded from: classes.dex */
public class az7 implements ag2, y37, px3, u70.b, k35 {
    public final Matrix a = new Matrix();
    public final Path b = new Path();
    public final g c;
    public final w70 d;
    public final String e;
    public final boolean f;
    public final l33 g;
    public final l33 h;
    public final xs9 i;
    public ce1 j;

    public az7(g gVar, w70 w70Var, zy7 zy7Var) {
        this.c = gVar;
        this.d = w70Var;
        this.e = zy7Var.a;
        this.f = zy7Var.e;
        l33 l33VarA = zy7Var.b.a();
        this.g = l33VarA;
        w70Var.f(l33VarA);
        l33VarA.a(this);
        l33 l33VarA2 = zy7Var.c.a();
        this.h = l33VarA2;
        w70Var.f(l33VarA2);
        l33VarA2.a(this);
        wk wkVar = zy7Var.d;
        wkVar.getClass();
        xs9 xs9Var = new xs9(wkVar);
        this.i = xs9Var;
        xs9Var.a(w70Var);
        xs9Var.b(this);
    }

    @Override // u70.b
    public final void a() {
        this.c.invalidateSelf();
    }

    @Override // defpackage.nd1
    public final void b(List list, List list2) {
        this.j.b(list, list2);
    }

    @Override // defpackage.j35
    public final void c(i35 i35Var, int i, ArrayList arrayList, i35 i35Var2) {
        mx5.g(i35Var, i, arrayList, i35Var2, this);
        for (int i2 = 0; i2 < this.j.i.size(); i2++) {
            nd1 nd1Var = (nd1) this.j.i.get(i2);
            if (nd1Var instanceof k35) {
                mx5.g(i35Var, i, arrayList, i35Var2, (k35) nd1Var);
            }
        }
    }

    @Override // defpackage.ag2
    public final void e(RectF rectF, Matrix matrix, boolean z) {
        this.j.e(rectF, matrix, z);
    }

    @Override // defpackage.px3
    public final void f(ListIterator listIterator) {
        if (this.j != null) {
            return;
        }
        while (listIterator.hasPrevious() && listIterator.previous() != this) {
        }
        ArrayList arrayList = new ArrayList();
        while (listIterator.hasPrevious()) {
            arrayList.add((nd1) listIterator.previous());
            listIterator.remove();
        }
        Collections.reverse(arrayList);
        this.j = new ce1(this.c, this.d, "Repeater", this.f, arrayList, null);
    }

    @Override // defpackage.nd1
    public final String getName() {
        return this.e;
    }

    @Override // defpackage.y37
    public final Path getPath() {
        Path path = this.j.getPath();
        Path path2 = this.b;
        path2.reset();
        float fFloatValue = ((Float) this.g.e()).floatValue();
        float fFloatValue2 = ((Float) this.h.e()).floatValue();
        for (int i = ((int) fFloatValue) - 1; i >= 0; i--) {
            Matrix matrixF = this.i.f(i + fFloatValue2);
            Matrix matrix = this.a;
            matrix.set(matrixF);
            path2.addPath(path, matrix);
        }
        return path2;
    }

    @Override // defpackage.j35
    public final void h(hl5 hl5Var, Object obj) {
        if (this.i.c(hl5Var, obj)) {
            return;
        }
        if (obj == xk5.p) {
            this.g.j(hl5Var);
        } else if (obj == xk5.q) {
            this.h.j(hl5Var);
        }
    }

    @Override // defpackage.ag2
    public final void i(Canvas canvas, Matrix matrix, int i, fg2 fg2Var) {
        float fFloatValue = ((Float) this.g.e()).floatValue();
        float fFloatValue2 = ((Float) this.h.e()).floatValue();
        xs9 xs9Var = this.i;
        float fFloatValue3 = ((Float) xs9Var.m.e()).floatValue() / 100.0f;
        float fFloatValue4 = ((Float) xs9Var.n.e()).floatValue() / 100.0f;
        for (int i2 = ((int) fFloatValue) - 1; i2 >= 0; i2--) {
            Matrix matrix2 = this.a;
            matrix2.set(matrix);
            float f = i2;
            matrix2.preConcat(xs9Var.f(f + fFloatValue2));
            this.j.i(canvas, matrix2, (int) (mx5.f(fFloatValue3, fFloatValue4, f / fFloatValue) * i), fg2Var);
        }
    }
}
