package l7;

import android.content.Context;
import androidx.compose.ui.platform.AndroidCompositionLocals_androidKt;
import com.google.firebase.crashlytics.internal.metadata.UserMetadata;
import java.util.List;
import kotlin.jvm.internal.t;
import kotlin.jvm.internal.v;
import kotlin.text.y;
import kotlin.text.z;
import n8.e0;
import q2.b0;
import q2.d;
import q2.o0;
import rm.n0;
import sm.c0;
import v0.z1;
import y0.l2;
import y0.x2;

/* loaded from: classes.dex */
public abstract class p {

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class a extends v implements dn.a {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ dn.a f27737p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ String f27738q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ Context f27739r;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        a(dn.a aVar, String str, Context context) {
            super(0);
            this.f27737p = aVar;
            this.f27738q = str;
            this.f27739r = context;
        }

        @Override // dn.a
        public /* bridge */ /* synthetic */ Object invoke() {
            m328invoke();
            return n0.f34904a;
        }

        /* renamed from: invoke, reason: collision with other method in class */
        public final void m328invoke() {
            dn.a aVar = this.f27737p;
            if (aVar != null) {
                aVar.invoke();
                return;
            }
            String str = this.f27738q;
            Context context = this.f27739r;
            if (str != null) {
                e0.f29852a.a(context, str);
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: package-private */
    /* loaded from: classes.dex */
    public static final class b extends v implements dn.p {

        /* renamed from: p, reason: collision with root package name */
        final /* synthetic */ String f27740p;

        /* renamed from: q, reason: collision with root package name */
        final /* synthetic */ String f27741q;

        /* renamed from: r, reason: collision with root package name */
        final /* synthetic */ String f27742r;

        /* renamed from: s, reason: collision with root package name */
        final /* synthetic */ o0 f27743s;

        /* renamed from: t, reason: collision with root package name */
        final /* synthetic */ l1.i f27744t;

        /* renamed from: u, reason: collision with root package name */
        final /* synthetic */ dn.a f27745u;

        /* renamed from: v, reason: collision with root package name */
        final /* synthetic */ int f27746v;

        /* renamed from: w, reason: collision with root package name */
        final /* synthetic */ int f27747w;

        /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
        b(String str, String str2, String str3, o0 o0Var, l1.i iVar, dn.a aVar, int i10, int i11) {
            super(2);
            this.f27740p = str;
            this.f27741q = str2;
            this.f27742r = str3;
            this.f27743s = o0Var;
            this.f27744t = iVar;
            this.f27745u = aVar;
            this.f27746v = i10;
            this.f27747w = i11;
        }

        public final void a(y0.m mVar, int i10) {
            p.a(this.f27740p, this.f27741q, this.f27742r, this.f27743s, this.f27744t, this.f27745u, mVar, l2.a(this.f27746v | 1), this.f27747w);
        }

        @Override // dn.p
        public /* bridge */ /* synthetic */ Object invoke(Object obj, Object obj2) {
            a((y0.m) obj, ((Number) obj2).intValue());
            return n0.f34904a;
        }
    }

    /* JADX WARN: Removed duplicated region for block: B:10:0x0057  */
    /* JADX WARN: Removed duplicated region for block: B:13:0x006e  */
    /* JADX WARN: Removed duplicated region for block: B:17:0x008a  */
    /* JADX WARN: Removed duplicated region for block: B:20:0x00a3  */
    /* JADX WARN: Removed duplicated region for block: B:24:0x00c6  */
    /* JADX WARN: Removed duplicated region for block: B:29:0x027f  */
    /* JADX WARN: Removed duplicated region for block: B:32:? A[RETURN, SYNTHETIC] */
    /* JADX WARN: Removed duplicated region for block: B:35:0x00da  */
    /* JADX WARN: Removed duplicated region for block: B:37:0x00e1  */
    /* JADX WARN: Removed duplicated region for block: B:39:0x00e6  */
    /* JADX WARN: Removed duplicated region for block: B:41:0x00ed  */
    /* JADX WARN: Removed duplicated region for block: B:44:0x00f4  */
    /* JADX WARN: Removed duplicated region for block: B:47:0x0131  */
    /* JADX WARN: Removed duplicated region for block: B:50:0x0209  */
    /* JADX WARN: Removed duplicated region for block: B:53:0x0272  */
    /* JADX WARN: Removed duplicated region for block: B:55:0x0216  */
    /* JADX WARN: Removed duplicated region for block: B:56:0x0186  */
    /* JADX WARN: Removed duplicated region for block: B:60:0x00e9  */
    /* JADX WARN: Removed duplicated region for block: B:61:0x00e3  */
    /* JADX WARN: Removed duplicated region for block: B:62:0x00dd  */
    /* JADX WARN: Removed duplicated region for block: B:63:0x00a7  */
    /* JADX WARN: Removed duplicated region for block: B:70:0x008d  */
    /* JADX WARN: Removed duplicated region for block: B:77:0x0071  */
    /* JADX WARN: Removed duplicated region for block: B:84:0x005a  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public static final void a(String str, String str2, String displayString, o0 o0Var, l1.i modifier, dn.a aVar, y0.m mVar, int i10, int i11) {
        String str3;
        int i12;
        String str4;
        int i13;
        o0 o0Var2;
        int i14;
        dn.a aVar2;
        String str5;
        List I0;
        List V0;
        String J;
        int h02;
        y0.m mVar2;
        String str6;
        o0 o0Var3;
        x2 y10;
        t.g(displayString, "displayString");
        t.g(modifier, "modifier");
        y0.m r10 = mVar.r(-622930174);
        int i15 = i11 & 1;
        if (i15 != 0) {
            i12 = i10 | 6;
            str3 = str;
        } else if ((i10 & 14) == 0) {
            str3 = str;
            i12 = (r10.R(str3) ? 4 : 2) | i10;
        } else {
            str3 = str;
            i12 = i10;
        }
        int i16 = i11 & 2;
        if (i16 != 0) {
            i12 |= 48;
        } else if ((i10 & 112) == 0) {
            str4 = str2;
            i12 |= r10.R(str4) ? 32 : 16;
            if ((i11 & 4) == 0) {
                i12 |= 384;
            } else if ((i10 & 896) == 0) {
                i12 |= r10.R(displayString) ? 256 : 128;
            }
            i13 = i11 & 8;
            if (i13 == 0) {
                i12 |= 3072;
            } else if ((i10 & 7168) == 0) {
                o0Var2 = o0Var;
                i12 |= r10.R(o0Var2) ? 2048 : UserMetadata.MAX_ATTRIBUTE_SIZE;
                if ((i11 & 16) != 0) {
                    i12 |= 24576;
                } else if ((57344 & i10) == 0) {
                    i12 |= r10.R(modifier) ? 16384 : UserMetadata.MAX_INTERNAL_KEY_SIZE;
                }
                i14 = i11 & 32;
                if (i14 != 0) {
                    i12 |= 196608;
                } else if ((458752 & i10) == 0) {
                    aVar2 = aVar;
                    i12 |= r10.m(aVar2) ? 131072 : 65536;
                    if ((374491 & i12) == 74898 || !r10.v()) {
                        str5 = i15 == 0 ? null : str3;
                        String str7 = i16 == 0 ? null : str4;
                        o0 o0Var4 = i13 == 0 ? null : o0Var2;
                        if (i14 != 0) {
                            aVar2 = null;
                        }
                        if (y0.p.H()) {
                            y0.p.Q(-622930174, i12, -1, "ca.canadapost.core.common.compose.components.CpcSpannableTextCompose (CpcSpannableTextCompose.kt:33)");
                        }
                        Context context = (Context) r10.t(AndroidCompositionLocals_androidKt.g());
                        r10.e(-577971688);
                        d.a aVar3 = new d.a(0, 1, null);
                        I0 = z.I0(displayString, new String[]{"%s"}, false, 0, 6, null);
                        V0 = c0.V0(I0);
                        if (V0.size() != 1) {
                            r10.e(1604033588);
                            aVar3.f(displayString);
                            aVar3.b(new b0(n7.a.f29827a.a(r10, 6).f().b(), 0L, v2.r.f38997q.a(), null, null, null, null, 0L, null, null, null, 0L, b3.k.f6700b.d(), null, null, null, 61434, null), 0, displayString.length());
                            r10.N();
                        } else {
                            r10.e(1604033982);
                            if (str5 != null) {
                                J = y.J(displayString, "%s", str5, false, 4, null);
                                h02 = z.h0(J, str5, 0, false, 6, null);
                                int length = str5.length() + h02;
                                aVar3.f(J);
                                aVar3.b(new b0(n7.a.f29827a.a(r10, 6).f().b(), 0L, v2.r.f38997q.a(), null, null, null, null, 0L, null, null, null, 0L, b3.k.f6700b.d(), null, null, null, 61434, null), h02, length);
                            }
                            r10.N();
                        }
                        q2.d m10 = aVar3.m();
                        r10.N();
                        r10.e(-577970423);
                        o0 k10 = o0Var4 != null ? n7.a.f29827a.c(r10, 6).k() : o0Var4;
                        r10.N();
                        dn.a aVar4 = aVar2;
                        String str8 = str7;
                        mVar2 = r10;
                        z1.c(m10, androidx.compose.foundation.d.d(modifier, false, null, o2.f.h(o2.f.f30548b.a()), new a(aVar2, str7, context), 3, null), 0L, 0L, null, null, null, 0L, null, b3.j.h(b3.j.f6691b.a()), 0L, 0, false, 0, 0, null, null, k10, mVar2, 0, 0, 130556);
                        if (y0.p.H()) {
                            y0.p.P();
                        }
                        aVar2 = aVar4;
                        str6 = str8;
                        o0Var3 = o0Var4;
                    } else {
                        r10.A();
                        str5 = str3;
                        str6 = str4;
                        o0Var3 = o0Var2;
                        mVar2 = r10;
                    }
                    y10 = mVar2.y();
                    if (y10 == null) {
                        y10.a(new b(str5, str6, displayString, o0Var3, modifier, aVar2, i10, i11));
                        return;
                    }
                    return;
                }
                aVar2 = aVar;
                if ((374491 & i12) == 74898) {
                }
                if (i15 == 0) {
                }
                if (i16 == 0) {
                }
                if (i13 == 0) {
                }
                if (i14 != 0) {
                }
                if (y0.p.H()) {
                }
                Context context2 = (Context) r10.t(AndroidCompositionLocals_androidKt.g());
                r10.e(-577971688);
                d.a aVar32 = new d.a(0, 1, null);
                I0 = z.I0(displayString, new String[]{"%s"}, false, 0, 6, null);
                V0 = c0.V0(I0);
                if (V0.size() != 1) {
                }
                q2.d m102 = aVar32.m();
                r10.N();
                r10.e(-577970423);
                if (o0Var4 != null) {
                }
                r10.N();
                dn.a aVar42 = aVar2;
                String str82 = str7;
                mVar2 = r10;
                z1.c(m102, androidx.compose.foundation.d.d(modifier, false, null, o2.f.h(o2.f.f30548b.a()), new a(aVar2, str7, context2), 3, null), 0L, 0L, null, null, null, 0L, null, b3.j.h(b3.j.f6691b.a()), 0L, 0, false, 0, 0, null, null, k10, mVar2, 0, 0, 130556);
                if (y0.p.H()) {
                }
                aVar2 = aVar42;
                str6 = str82;
                o0Var3 = o0Var4;
                y10 = mVar2.y();
                if (y10 == null) {
                }
            }
            o0Var2 = o0Var;
            if ((i11 & 16) != 0) {
            }
            i14 = i11 & 32;
            if (i14 != 0) {
            }
            aVar2 = aVar;
            if ((374491 & i12) == 74898) {
            }
            if (i15 == 0) {
            }
            if (i16 == 0) {
            }
            if (i13 == 0) {
            }
            if (i14 != 0) {
            }
            if (y0.p.H()) {
            }
            Context context22 = (Context) r10.t(AndroidCompositionLocals_androidKt.g());
            r10.e(-577971688);
            d.a aVar322 = new d.a(0, 1, null);
            I0 = z.I0(displayString, new String[]{"%s"}, false, 0, 6, null);
            V0 = c0.V0(I0);
            if (V0.size() != 1) {
            }
            q2.d m1022 = aVar322.m();
            r10.N();
            r10.e(-577970423);
            if (o0Var4 != null) {
            }
            r10.N();
            dn.a aVar422 = aVar2;
            String str822 = str7;
            mVar2 = r10;
            z1.c(m1022, androidx.compose.foundation.d.d(modifier, false, null, o2.f.h(o2.f.f30548b.a()), new a(aVar2, str7, context22), 3, null), 0L, 0L, null, null, null, 0L, null, b3.j.h(b3.j.f6691b.a()), 0L, 0, false, 0, 0, null, null, k10, mVar2, 0, 0, 130556);
            if (y0.p.H()) {
            }
            aVar2 = aVar422;
            str6 = str822;
            o0Var3 = o0Var4;
            y10 = mVar2.y();
            if (y10 == null) {
            }
        }
        str4 = str2;
        if ((i11 & 4) == 0) {
        }
        i13 = i11 & 8;
        if (i13 == 0) {
        }
        o0Var2 = o0Var;
        if ((i11 & 16) != 0) {
        }
        i14 = i11 & 32;
        if (i14 != 0) {
        }
        aVar2 = aVar;
        if ((374491 & i12) == 74898) {
        }
        if (i15 == 0) {
        }
        if (i16 == 0) {
        }
        if (i13 == 0) {
        }
        if (i14 != 0) {
        }
        if (y0.p.H()) {
        }
        Context context222 = (Context) r10.t(AndroidCompositionLocals_androidKt.g());
        r10.e(-577971688);
        d.a aVar3222 = new d.a(0, 1, null);
        I0 = z.I0(displayString, new String[]{"%s"}, false, 0, 6, null);
        V0 = c0.V0(I0);
        if (V0.size() != 1) {
        }
        q2.d m10222 = aVar3222.m();
        r10.N();
        r10.e(-577970423);
        if (o0Var4 != null) {
        }
        r10.N();
        dn.a aVar4222 = aVar2;
        String str8222 = str7;
        mVar2 = r10;
        z1.c(m10222, androidx.compose.foundation.d.d(modifier, false, null, o2.f.h(o2.f.f30548b.a()), new a(aVar2, str7, context222), 3, null), 0L, 0L, null, null, null, 0L, null, b3.j.h(b3.j.f6691b.a()), 0L, 0, false, 0, 0, null, null, k10, mVar2, 0, 0, 130556);
        if (y0.p.H()) {
        }
        aVar2 = aVar4222;
        str6 = str8222;
        o0Var3 = o0Var4;
        y10 = mVar2.y();
        if (y10 == null) {
        }
    }
}
