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

import A4.d;
import I0.J;
import J4.a;
import android.graphics.Paint;
import androidx.compose.runtime.Stable;
import h1.m;
import kotlin.jvm.internal.h;
import kotlin.jvm.internal.o;
import kotlin.jvm.internal.p;
import m1.g;
import m3.AbstractC2467b;
import o0.e;
import p0.AbstractC2686D;
import p0.C2714u;
import p0.InterfaceC2712s;
import p0.N;
import p0.O;
import p0.X;
import q.AbstractC2761L;
import q.AbstractC2771e;
import q.C2756G;
import q.C2769d;
import q.C2790n0;
import q.InterfaceC2787m;
import r0.C2863b;
import r0.InterfaceC2864c;
import w4.C3137A;

/* JADX INFO: loaded from: classes3.dex */
@Stable
public final class Placeholder {
    public static final int $stable = 0;
    private final long color;
    private final C2769d contentAlpha;
    private final a contentFadeTransitionSpec;
    private final PlaceholderHighlight highlight;
    private final C2769d highlightProgress;
    private m lastLayoutDirection;
    private N lastOutline;
    private e lastSize;
    private final O paint;
    private final C2769d placeholderAlpha;
    private final a placeholderFadeTransitionSpec;
    private final X shape;
    private final boolean visible;

    /* JADX INFO: renamed from: com.revenuecat.purchases.ui.revenuecatui.composables.Placeholder$1, reason: invalid class name */
    public static final class AnonymousClass1 extends p implements a {
        public static final AnonymousClass1 INSTANCE = new AnonymousClass1();

        public AnonymousClass1() {
            super(0);
        }

        @Override // J4.a
        public final C2790n0 invoke() {
            return AbstractC2771e.o(0.0f, 0.0f, null, 7);
        }
    }

    /* JADX INFO: renamed from: com.revenuecat.purchases.ui.revenuecatui.composables.Placeholder$2, reason: invalid class name */
    public static final class AnonymousClass2 extends p implements a {
        public static final AnonymousClass2 INSTANCE = new AnonymousClass2();

        public AnonymousClass2() {
            super(0);
        }

        @Override // J4.a
        public final C2790n0 invoke() {
            return AbstractC2771e.o(0.0f, 0.0f, null, 7);
        }
    }

    public /* synthetic */ Placeholder(boolean z6, long j4, X x6, PlaceholderHighlight placeholderHighlight, a aVar, a aVar2, h hVar) {
        this(z6, j4, x6, placeholderHighlight, aVar, aVar2);
    }

    private final boolean component1() {
        return this.visible;
    }

    /* JADX INFO: renamed from: component2-0d7_KjU, reason: not valid java name */
    private final long m872component20d7_KjU() {
        return this.color;
    }

    private final X component3() {
        return this.shape;
    }

    private final PlaceholderHighlight component4() {
        return this.highlight;
    }

    private final a component5() {
        return this.placeholderFadeTransitionSpec;
    }

    private final a component6() {
        return this.contentFadeTransitionSpec;
    }

    /* JADX INFO: renamed from: copy-3IgeMak$default, reason: not valid java name */
    public static /* synthetic */ Placeholder m873copy3IgeMak$default(Placeholder placeholder, boolean z6, long j4, X x6, PlaceholderHighlight placeholderHighlight, a aVar, a aVar2, int i6, Object obj) {
        if ((i6 & 1) != 0) {
            z6 = placeholder.visible;
        }
        if ((i6 & 2) != 0) {
            j4 = placeholder.color;
        }
        if ((i6 & 4) != 0) {
            x6 = placeholder.shape;
        }
        if ((i6 & 8) != 0) {
            placeholderHighlight = placeholder.highlight;
        }
        if ((i6 & 16) != 0) {
            aVar = placeholder.placeholderFadeTransitionSpec;
        }
        if ((i6 & 32) != 0) {
            aVar2 = placeholder.contentFadeTransitionSpec;
        }
        return placeholder.m874copy3IgeMak(z6, j4, x6, placeholderHighlight, aVar, aVar2);
    }

    /* JADX INFO: renamed from: copy-3IgeMak, reason: not valid java name */
    public final Placeholder m874copy3IgeMak(boolean z6, long j4, X shape, PlaceholderHighlight placeholderHighlight, a placeholderFadeTransitionSpec, a contentFadeTransitionSpec) {
        o.h(shape, "shape");
        o.h(placeholderFadeTransitionSpec, "placeholderFadeTransitionSpec");
        o.h(contentFadeTransitionSpec, "contentFadeTransitionSpec");
        return new Placeholder(z6, j4, shape, placeholderHighlight, placeholderFadeTransitionSpec, contentFadeTransitionSpec, null);
    }

    public final void draw$revenuecatui_defaultsBc8Release(InterfaceC2864c interfaceC2864c) {
        InterfaceC2864c interfaceC2864c2;
        o.h(interfaceC2864c, "<this>");
        float fFloatValue = ((Number) this.placeholderAlpha.d()).floatValue();
        float fFloatValue2 = ((Number) this.contentAlpha.d()).floatValue();
        if (fFloatValue2 > 0.01f) {
            ((I2.O) this.paint).e(fFloatValue2);
            O o6 = this.paint;
            J j4 = (J) interfaceC2864c;
            C2863b c2863b = j4.f2210a;
            InterfaceC2712s interfaceC2712sC = c2863b.f23803b.c();
            interfaceC2712sC.a(g.b(0L, c2863b.c()), o6);
            j4.b();
            interfaceC2712sC.r();
        }
        if (fFloatValue > 0.01f) {
            ((I2.O) this.paint).e(fFloatValue);
            O o7 = this.paint;
            C2863b c2863b2 = ((J) interfaceC2864c).f2210a;
            InterfaceC2712s interfaceC2712sC2 = c2863b2.f23803b.c();
            interfaceC2712sC2.a(g.b(0L, c2863b2.c()), o7);
            interfaceC2864c2 = interfaceC2864c;
            this.lastOutline = PlaceholderKt.m876drawPlaceholderhpmOzss(interfaceC2864c2, this.shape, this.color, this.highlight, ((Number) this.highlightProgress.d()).floatValue(), this.lastOutline, this.lastLayoutDirection, this.lastSize);
            interfaceC2712sC2.r();
        } else {
            interfaceC2864c2 = interfaceC2864c;
        }
        J j6 = (J) interfaceC2864c2;
        this.lastSize = new e(j6.f2210a.c());
        this.lastLayoutDirection = j6.getLayoutDirection();
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (!(obj instanceof Placeholder)) {
            return false;
        }
        Placeholder placeholder = (Placeholder) obj;
        return this.visible == placeholder.visible && C2714u.d(this.color, placeholder.color) && o.c(this.shape, placeholder.shape) && o.c(this.highlight, placeholder.highlight) && o.c(this.placeholderFadeTransitionSpec, placeholder.placeholderFadeTransitionSpec) && o.c(this.contentFadeTransitionSpec, placeholder.contentFadeTransitionSpec);
    }

    public int hashCode() {
        int iHashCode = Boolean.hashCode(this.visible) * 31;
        long j4 = this.color;
        int i6 = C2714u.f22946n;
        int iHashCode2 = (this.shape.hashCode() + com.google.android.recaptcha.internal.a.e(iHashCode, 31, j4)) * 31;
        PlaceholderHighlight placeholderHighlight = this.highlight;
        return this.contentFadeTransitionSpec.hashCode() + ((this.placeholderFadeTransitionSpec.hashCode() + ((iHashCode2 + (placeholderHighlight == null ? 0 : placeholderHighlight.hashCode())) * 31)) * 31);
    }

    /* JADX WARN: Removed duplicated region for block: B:44:0x00d2  */
    /* JADX WARN: Removed duplicated region for block: B:50:0x00e1  */
    /* JADX WARN: Removed duplicated region for block: B:54:0x00f1 A[PHI: r1 r3 r5
      0x00f1: PHI (r1v12 float) = (r1v11 float), (r1v19 float) binds: [B:52:0x00ee, B:22:0x004b] A[DONT_GENERATE, DONT_INLINE]
      0x00f1: PHI (r3v15 int) = (r3v9 int), (r3v22 int) binds: [B:52:0x00ee, B:22:0x004b] A[DONT_GENERATE, DONT_INLINE]
      0x00f1: PHI (r5v11 com.revenuecat.purchases.ui.revenuecatui.composables.Placeholder) = 
      (r5v10 com.revenuecat.purchases.ui.revenuecatui.composables.Placeholder)
      (r5v15 com.revenuecat.purchases.ui.revenuecatui.composables.Placeholder)
     binds: [B:52:0x00ee, B:22:0x004b] A[DONT_GENERATE, DONT_INLINE]] */
    /* JADX WARN: Removed duplicated region for block: B:55:0x00f3  */
    /* JADX WARN: Removed duplicated region for block: B:58:0x0114  */
    /* JADX WARN: Removed duplicated region for block: B:60:0x0125 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:61:0x0126 A[RETURN] */
    /* JADX WARN: Removed duplicated region for block: B:8:0x0018  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object startAnimation$revenuecatui_defaultsBc8Release(d dVar) {
        Placeholder$startAnimation$1 placeholder$startAnimation$1;
        float f6;
        float f7;
        float f8;
        int i6;
        Placeholder placeholder;
        Placeholder placeholder2;
        int i7;
        C2769d c2769d;
        if (dVar instanceof Placeholder$startAnimation$1) {
            placeholder$startAnimation$1 = (Placeholder$startAnimation$1) dVar;
            int i8 = placeholder$startAnimation$1.label;
            if ((i8 & Integer.MIN_VALUE) != 0) {
                placeholder$startAnimation$1.label = i8 - Integer.MIN_VALUE;
            } else {
                placeholder$startAnimation$1 = new Placeholder$startAnimation$1(this, dVar);
            }
        }
        Placeholder$startAnimation$1 placeholder$startAnimation$12 = placeholder$startAnimation$1;
        Object obj = placeholder$startAnimation$12.result;
        B4.a aVar = B4.a.f492a;
        int i9 = placeholder$startAnimation$12.label;
        C3137A c3137a = C3137A.f25453a;
        if (i9 == 0) {
            AbstractC2467b.l(obj);
            C2769d c2769d2 = this.placeholderAlpha;
            if (this.visible) {
                f7 = 1.0f;
                f6 = 1.0f;
            } else {
                f6 = 1.0f;
                f7 = 0.0f;
            }
            Float f9 = new Float(f7);
            InterfaceC2787m interfaceC2787m = (InterfaceC2787m) this.placeholderFadeTransitionSpec.invoke();
            placeholder$startAnimation$12.L$0 = this;
            placeholder$startAnimation$12.label = 1;
            f8 = f6;
            i6 = 1;
            if (C2769d.c(c2769d2, f9, interfaceC2787m, null, placeholder$startAnimation$12, 12) != aVar) {
                placeholder = this;
            }
        }
        if (i9 == 1) {
            placeholder = (Placeholder) placeholder$startAnimation$12.L$0;
            AbstractC2467b.l(obj);
            f8 = 1.0f;
            i6 = 1;
        } else {
            if (i9 == 2) {
                Placeholder placeholder3 = (Placeholder) placeholder$startAnimation$12.L$0;
                AbstractC2467b.l(obj);
                f8 = 1.0f;
                i6 = 1;
                placeholder2 = placeholder3;
                if (placeholder2.visible) {
                    PlaceholderHighlight placeholderHighlight = placeholder2.highlight;
                    if ((placeholderHighlight != null ? placeholderHighlight.getAnimationSpec() : null) != null) {
                        i7 = i6;
                    }
                    c2769d = placeholder2.highlightProgress;
                    placeholder$startAnimation$12.L$0 = placeholder2;
                    placeholder$startAnimation$12.I$0 = i7;
                    placeholder$startAnimation$12.label = 3;
                    if (c2769d.f(placeholder$startAnimation$12) != aVar) {
                    }
                } else {
                    i7 = 0;
                    c2769d = placeholder2.highlightProgress;
                    placeholder$startAnimation$12.L$0 = placeholder2;
                    placeholder$startAnimation$12.I$0 = i7;
                    placeholder$startAnimation$12.label = 3;
                    if (c2769d.f(placeholder$startAnimation$12) != aVar) {
                        if (i7 == 0) {
                        }
                    }
                }
            }
            if (i9 != 3) {
                if (i9 == 4) {
                    AbstractC2467b.l(obj);
                    return c3137a;
                }
                if (i9 != 5) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC2467b.l(obj);
                return c3137a;
            }
            i7 = placeholder$startAnimation$12.I$0;
            placeholder2 = (Placeholder) placeholder$startAnimation$12.L$0;
            AbstractC2467b.l(obj);
            f8 = 1.0f;
            if (i7 == 0) {
                C2769d c2769d3 = placeholder2.highlightProgress;
                Float f10 = new Float(f8);
                PlaceholderHighlight placeholderHighlight2 = placeholder2.highlight;
                o.e(placeholderHighlight2);
                C2756G animationSpec = placeholderHighlight2.getAnimationSpec();
                o.e(animationSpec);
                placeholder$startAnimation$12.L$0 = null;
                placeholder$startAnimation$12.label = 4;
                return C2769d.c(c2769d3, f10, animationSpec, null, placeholder$startAnimation$12, 12) == aVar ? aVar : c3137a;
            }
            C2769d c2769d4 = placeholder2.highlightProgress;
            Float f11 = new Float(0.0f);
            placeholder$startAnimation$12.L$0 = null;
            placeholder$startAnimation$12.label = 5;
            if (c2769d4.e(placeholder$startAnimation$12, f11) == aVar) {
            }
        }
        C2769d c2769d5 = placeholder.contentAlpha;
        Float f12 = new Float(placeholder.visible ? 0.0f : f8);
        InterfaceC2787m interfaceC2787m2 = (InterfaceC2787m) placeholder.contentFadeTransitionSpec.invoke();
        placeholder$startAnimation$12.L$0 = placeholder;
        placeholder$startAnimation$12.label = 2;
        Placeholder placeholder4 = placeholder;
        if (C2769d.c(c2769d5, f12, interfaceC2787m2, null, placeholder$startAnimation$12, 12) != aVar) {
            placeholder2 = placeholder4;
            if (placeholder2.visible) {
            }
        }
    }

    /* JADX WARN: Code restructure failed: missing block: B:26:0x006e, code lost:
    
        if (r7.f(r0) != r1) goto L28;
     */
    /* JADX WARN: Removed duplicated region for block: B:7:0x0013  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final Object stopAnimation$revenuecatui_defaultsBc8Release(d dVar) {
        Placeholder$stopAnimation$1 placeholder$stopAnimation$1;
        Placeholder placeholder;
        if (dVar instanceof Placeholder$stopAnimation$1) {
            placeholder$stopAnimation$1 = (Placeholder$stopAnimation$1) dVar;
            int i6 = placeholder$stopAnimation$1.label;
            if ((i6 & Integer.MIN_VALUE) != 0) {
                placeholder$stopAnimation$1.label = i6 - Integer.MIN_VALUE;
            } else {
                placeholder$stopAnimation$1 = new Placeholder$stopAnimation$1(this, dVar);
            }
        }
        Object obj = placeholder$stopAnimation$1.result;
        B4.a aVar = B4.a.f492a;
        int i7 = placeholder$stopAnimation$1.label;
        if (i7 == 0) {
            AbstractC2467b.l(obj);
            C2769d c2769d = this.placeholderAlpha;
            placeholder$stopAnimation$1.L$0 = this;
            placeholder$stopAnimation$1.label = 1;
            if (c2769d.f(placeholder$stopAnimation$1) != aVar) {
                placeholder = this;
            }
            return aVar;
        }
        if (i7 == 1) {
            placeholder = (Placeholder) placeholder$stopAnimation$1.L$0;
            AbstractC2467b.l(obj);
        } else {
            if (i7 != 2) {
                if (i7 != 3) {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                AbstractC2467b.l(obj);
                return C3137A.f25453a;
            }
            placeholder = (Placeholder) placeholder$stopAnimation$1.L$0;
            AbstractC2467b.l(obj);
            C2769d c2769d2 = placeholder.highlightProgress;
            placeholder$stopAnimation$1.L$0 = null;
            placeholder$stopAnimation$1.label = 3;
        }
        C2769d c2769d3 = placeholder.contentAlpha;
        placeholder$stopAnimation$1.L$0 = placeholder;
        placeholder$stopAnimation$1.label = 2;
        if (c2769d3.f(placeholder$stopAnimation$1) != aVar) {
            C2769d c2769d22 = placeholder.highlightProgress;
            placeholder$stopAnimation$1.L$0 = null;
            placeholder$stopAnimation$1.label = 3;
        }
        return aVar;
    }

    public String toString() {
        StringBuilder sb = new StringBuilder("Placeholder(visible=");
        sb.append(this.visible);
        sb.append(", color=");
        AbstractC2761L.n(this.color, ", shape=", sb);
        sb.append(this.shape);
        sb.append(", highlight=");
        sb.append(this.highlight);
        sb.append(", placeholderFadeTransitionSpec=");
        sb.append(this.placeholderFadeTransitionSpec);
        sb.append(", contentFadeTransitionSpec=");
        sb.append(this.contentFadeTransitionSpec);
        sb.append(')');
        return sb.toString();
    }

    private Placeholder(boolean z6, long j4, X shape, PlaceholderHighlight placeholderHighlight, a placeholderFadeTransitionSpec, a contentFadeTransitionSpec) {
        o.h(shape, "shape");
        o.h(placeholderFadeTransitionSpec, "placeholderFadeTransitionSpec");
        o.h(contentFadeTransitionSpec, "contentFadeTransitionSpec");
        this.visible = z6;
        this.color = j4;
        this.shape = shape;
        this.highlight = placeholderHighlight;
        this.placeholderFadeTransitionSpec = placeholderFadeTransitionSpec;
        this.contentFadeTransitionSpec = contentFadeTransitionSpec;
        this.placeholderAlpha = AbstractC2771e.a(z6 ? 1.0f : 0.0f);
        this.contentAlpha = AbstractC2771e.a(z6 ? 0.0f : 1.0f);
        this.highlightProgress = AbstractC2771e.a(0.0f);
        I2.O oI = AbstractC2686D.i();
        ((Paint) oI.f2524b).setAntiAlias(true);
        oI.n(0);
        oI.f(oI.f2523a);
        this.paint = oI;
    }

    public /* synthetic */ Placeholder(boolean z6, long j4, X x6, PlaceholderHighlight placeholderHighlight, a aVar, a aVar2, int i6, h hVar) {
        this(z6, j4, (i6 & 4) != 0 ? AbstractC2686D.f22844b : x6, (i6 & 8) != 0 ? null : placeholderHighlight, (i6 & 16) != 0 ? AnonymousClass1.INSTANCE : aVar, (i6 & 32) != 0 ? AnonymousClass2.INSTANCE : aVar2, null);
    }
}
