LINE.apk(点击下载) / AvatarActivityV2.java


package com.linecorp.line.avatar.v2;

import a00.g;
import ai.clova.cic.clientlib.exoplayer2.text.ttml.TtmlNode;
import android.animation.Animator;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.content.ClipData;
import android.content.ClipDescription;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
import androidx.appcompat.app.AlertController;
import androidx.appcompat.app.f;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.lifecycle.e1;
import androidx.lifecycle.o0;
import b2.b;
import bz.c;
import com.google.gson.Gson;
import com.linecorp.andromeda.render.view.RenderTextureView;
import com.linecorp.line.avatar.common.AvatarIntentHelper$IntentParams;
import com.linecorp.line.avatar.suggestion.agreement.SuggestionAgreementActivity;
import com.linecorp.line.avatar.v2.background.AvatarBackgroundFragment;
import com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2;
import com.linecorp.line.avatar.v2.debug.AvatarStatusInfoManagerV2;
import com.linecorp.line.avatar.v2.gesture.AvatarGestureFragment;
import com.linecorp.line.avatar.v2.guide.AvatarFocusGuide;
import com.linecorp.line.avatar.v2.guide.AvatarMainGuide;
import com.linecorp.line.avatar.v2.introduction.AvatarIntroductionPageActivity;
import com.linecorp.line.avatar.v2.loading.AvatarLoadFragmentV2;
import com.linecorp.line.avatar.v2.loading.AvatarShortLoadFragmentV2;
import com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2;
import com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment;
import com.linecorp.line.avatar.v2.main.popup.AvatarCreateStickerFragment;
import com.linecorp.line.avatar.v2.main.popup.AvatarTermOfUseFragment;
import com.linecorp.line.avatar.v2.promotion.AvatarPromotionFragmentV2;
import com.linecorp.line.avatar.v2.suggestion.AvatarSuggestionFragmentV2;
import com.linecorp.line.avatar.view.AvatarNonTransparentProgressFragment;
import com.linecorp.line.avatar.view.AvatarProgressDialogFragment;
import com.linecorp.line.share.common.model.ChosenChat;
import com.linecorp.rxeventbus.Subscribe;
import com.linecorp.rxeventbus.SubscriberType;
import com.linecorp.yuki.base.android.YukiDebugService;
import com.linecorp.yuki.content.android.YukiPackageService;
import com.linecorp.yuki.content.android.sticker.YukiSticker;
import com.linecorp.yuki.content.android.sticker.YukiStickerCategory;
import com.linecorp.yuki.content.android.sticker.YukiStickerInfo;
import com.linecorp.yuki.effect.android.ProjectParam;
import com.linecorp.yuki.effect.android.YukiEffectService;
import cz.u;
import dz.d;
import em3.i0;
import fg3.a;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Locale;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
import java.util.Set;
import jp.naver.line.android.R;
import jp.naver.line.android.analytics.ga.annotation.GAScreenTracking;
import jp.naver.line.android.common.PermissionRequestActivity;
import jp.naver.line.android.util.p0;
import jr2.p;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.NoWhenBranchMatchedException;
import kotlin.Pair;
import kotlin.ResultKt;
import kotlin.TuplesKt;
import kotlin.Unit;
import m00.a;
import sz.a1;
import sz.b1;
import sz.d1;
import sz.g1;
import sz.h1;
import sz.i1;
import sz.l0;
import sz.m1;
import sz.n1;
import sz.o1;
import sz.q0;
import sz.r0;
import sz.s0;
import sz.u0;
import sz.v0;
import sz.z0;
import um3.s1;
import um3.w0;
import um3.x1;
import uy.c;
import uz.s;
import vd3.a;
import wy.a;
import zy.j0;

@Metadata(bv = {}, d1 = {"\u0000V\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0005\b\u0000\u0018\u00002\u00020\u00012\u00020\u00022\u00020\u00032\u00020\u00042\u00020\u00052\u00020\u00062\u00020\u00072\u00020\b2\u00020\t2\u00020\n2\u00020\u000b2\u00020\f2\u00020\r2\u00020\u000e2\u00020\u000f2\u00020\u00102\u00020\u0011:\u0001\u0018B\u0007¢\u0006\u0004\b\u0016\u0010\u0017J\u0010\u0010\u0015\u001a\u00020\u00142\u0006\u0010\u0013\u001a\u00020\u0012H\u0007¨\u0006\u0019"}, d2 = {"Lcom/linecorp/line/avatar/v2/AvatarActivityV2;", "Luy/d;", "Lcom/linecorp/line/avatar/v2/main/AvatarMainFragmentV2$a;", "Lcom/linecorp/line/avatar/v2/main/focusview/AvatarFocusViewFragment$b;", "Lcom/linecorp/line/avatar/v2/background/AvatarBackgroundFragment$a;", "Lcom/linecorp/line/avatar/v2/gesture/AvatarGestureFragment$a;", "Lcom/linecorp/line/avatar/v2/customization/AvatarCustomizationFragmentV2$b;", "Lcom/linecorp/line/avatar/v2/customization/AvatarCustomizationFragmentV2$d;", "Lcom/linecorp/line/avatar/v2/suggestion/AvatarSuggestionFragmentV2$a;", "Lcom/linecorp/line/avatar/v2/promotion/AvatarPromotionFragmentV2$a;", "Lcom/linecorp/line/avatar/v2/loading/AvatarLoadFragmentV2$b;", "Lcom/linecorp/line/avatar/v2/loading/AvatarShortLoadFragmentV2$a;", "Lcom/linecorp/line/avatar/view/AvatarProgressDialogFragment$b;", "Lcom/linecorp/line/avatar/view/AvatarNonTransparentProgressFragment$a;", "Lcom/linecorp/line/avatar/v2/main/popup/AvatarCreateStickerFragment$a;", "Lcom/linecorp/line/avatar/v2/main/popup/AvatarTermOfUseFragment$a;", "Lcom/linecorp/line/avatar/v2/guide/AvatarMainGuide$a;", "Lcom/linecorp/line/avatar/v2/guide/AvatarFocusGuide$a;", "Laz/a;", "event", "", "onChangedLatestUpdateTime", "<init>", "()V", "a", "avatar_release"}, k = 1, mv = {1, 6, 0})
public final class AvatarActivityV2 extends uy.d implements AvatarMainFragmentV2.a, AvatarFocusViewFragment.b, AvatarBackgroundFragment.a, AvatarGestureFragment.a, AvatarCustomizationFragmentV2.b, AvatarCustomizationFragmentV2.d, AvatarSuggestionFragmentV2.a, AvatarPromotionFragmentV2.a, AvatarLoadFragmentV2.b, AvatarShortLoadFragmentV2.a, AvatarProgressDialogFragment.b, AvatarNonTransparentProgressFragment.a, AvatarCreateStickerFragment.a, AvatarTermOfUseFragment.a, AvatarMainGuide.a, AvatarFocusGuide.a {
    public static final /* synthetic */ int J = 0;
    public boolean A;
    public final Lazy B = LazyKt.lazy(new h(this));
    public final androidx.activity.result.c<Intent> C;
    public final androidx.activity.result.c<Intent> D;
    public final androidx.activity.result.c<Intent> E;
    public final Lazy F;
    public s1 G;
    public um3.r<a> H;
    public boolean I;

    /* renamed from: d  reason: collision with root package name */
    public final String[] f34729d = {"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"};

    /* renamed from: e  reason: collision with root package name */
    public boolean f34730e;

    /* renamed from: f  reason: collision with root package name */
    public boolean f34731f = true;

    /* renamed from: g  reason: collision with root package name */
    public boolean f34732g;

    /* renamed from: h  reason: collision with root package name */
    public int f34733h;

    /* renamed from: i  reason: collision with root package name */
    public int f34734i;

    /* renamed from: j  reason: collision with root package name */
    public zy.b f34735j;

    /* renamed from: k  reason: collision with root package name */
    public l0 f34736k;

    /* renamed from: l  reason: collision with root package name */
    public s0 f34737l;

    /* renamed from: m  reason: collision with root package name */
    public c00.g f34738m;

    /* renamed from: n  reason: collision with root package name */
    public final r0 f34739n = new r0();

    /* renamed from: o  reason: collision with root package name */
    public final Lazy f34740o = LazyKt.lazy(c.f34762b);

    /* renamed from: p  reason: collision with root package name */
    public final Lazy f34741p = LazyKt.lazy(new e(this));

    /* renamed from: q  reason: collision with root package name */
    public final Lazy f34742q = androidx.fragment.app.u.e(this, bz.c.f15891e0);

    /* renamed from: r  reason: collision with root package name */
    public final Lazy f34743r = LazyKt.lazy(d.f34764b);

    /* renamed from: s  reason: collision with root package name */
    public boolean f34744s;

    /* renamed from: t  reason: collision with root package name */
    public s1 f34745t;

    /* renamed from: u  reason: collision with root package name */
    public s1 f34746u;

    /* renamed from: v  reason: collision with root package name */
    public boolean f34747v;

    /* renamed from: w  reason: collision with root package name */
    public String f34748w;

    /* renamed from: x  reason: collision with root package name */
    public s1 f34749x;

    /* renamed from: y  reason: collision with root package name */
    public s1 f34750y;

    /* renamed from: z  reason: collision with root package name */
    public s1 f34751z;

    public static final class a {

        /* renamed from: a  reason: collision with root package name */
        public final String f34752a;

        /* renamed from: b  reason: collision with root package name */
        public final String f34753b;

        /* renamed from: c  reason: collision with root package name */
        public final String f34754c;

        public a() {
            this(null, null, null, 7);
        }

        public a(String str, String str2, String str3, int i14) {
            str = (i14 & 1) != 0 ? null : str;
            str2 = (i14 & 2) != 0 ? null : str2;
            str3 = (i14 & 4) != 0 ? null : str3;
            this.f34752a = str;
            this.f34753b = str2;
            this.f34754c = str3;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof a)) {
                return false;
            }
            a aVar = (a) obj;
            return em3.q.b(this.f34752a, aVar.f34752a) && em3.q.b(this.f34753b, aVar.f34753b) && em3.q.b(this.f34754c, aVar.f34754c);
        }

        public int hashCode() {
            String str = this.f34752a;
            int i14 = 0;
            int hashCode = (str == null ? 0 : str.hashCode()) * 31;
            String str2 = this.f34753b;
            int hashCode2 = (hashCode + (str2 == null ? 0 : str2.hashCode())) * 31;
            String str3 = this.f34754c;
            if (str3 != null) {
                i14 = str3.hashCode();
            }
            return hashCode2 + i14;
        }

        public String toString() {
            StringBuilder a14 = b.d.a("AfterAvatarMetaChangeActionInfo(createdAvatarId=");
            a14.append(this.f34752a);
            a14.append(", editedAvatarId=");
            a14.append(this.f34753b);
            a14.append(", avatarHash=");
            return m7.l.a(a14, this.f34754c, ')');
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$openCustomization$1", f = "AvatarActivityV2.kt", l = {2085}, m = "invokeSuspend")
    public static final class a0 extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public int f34755b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34756c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ boolean f34757d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public a0(AvatarActivityV2 avatarActivityV2, boolean z14, ul3.d<? super a0> dVar) {
            super(2, dVar);
            this.f34756c = avatarActivityV2;
            this.f34757d = z14;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new a0(this.f34756c, this.f34757d, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new a0(this.f34756c, this.f34757d, dVar).invokeSuspend(Unit.INSTANCE);
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34755b;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                l0 l0Var = this.f34756c.f34736k;
                if (l0Var == null) {
                    em3.q.l("viewModel");
                    throw null;
                } else if (em3.q.b(l0Var.W.getValue(), Boolean.TRUE)) {
                    AvatarActivityV2 avatarActivityV2 = this.f34756c;
                    l0 l0Var2 = avatarActivityV2.f34736k;
                    if (l0Var2 != null) {
                        this.f34755b = 1;
                        if (l0Var2.G6(avatarActivityV2, this) == aVar) {
                            return aVar;
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                }
            } else if (i14 == 1) {
                ResultKt.throwOnFailure(obj);
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AvatarActivityV2 avatarActivityV22 = this.f34756c;
            l0 l0Var3 = avatarActivityV22.f34736k;
            if (l0Var3 != null) {
                AvatarActivityV2.Y8(avatarActivityV22, new z0.a.b(l0Var3.f146838i, !this.f34757d, null, null, null, false, 32), false, 2);
                return Unit.INSTANCE;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    public /* synthetic */ class b {
        public static final /* synthetic */ int[] $EnumSwitchMapping$0;
        public static final /* synthetic */ int[] $EnumSwitchMapping$1;
        public static final /* synthetic */ int[] $EnumSwitchMapping$2;
        public static final /* synthetic */ int[] $EnumSwitchMapping$3;
        public static final /* synthetic */ int[] $EnumSwitchMapping$4;

        static {
            int[] iArr = new int[k61.d.a().length];
            iArr[j.q.e(1)] = 1;
            iArr[j.q.e(2)] = 2;
            iArr[j.q.e(3)] = 3;
            $EnumSwitchMapping$0 = iArr;
            int[] iArr2 = new int[cz.b.a().length];
            iArr2[j.q.e(3)] = 1;
            iArr2[j.q.e(4)] = 2;
            $EnumSwitchMapping$1 = iArr2;
            int[] iArr3 = new int[cz.s.a().length];
            iArr3[j.q.e(2)] = 1;
            iArr3[j.q.e(3)] = 2;
            iArr3[j.q.e(6)] = 3;
            iArr3[j.q.e(8)] = 4;
            $EnumSwitchMapping$2 = iArr3;
            int[] iArr4 = new int[cz.q.a().length];
            iArr4[j.q.e(1)] = 1;
            iArr4[j.q.e(2)] = 2;
            iArr4[j.q.e(3)] = 3;
            $EnumSwitchMapping$3 = iArr4;
            int[] iArr5 = new int[n1.a().length];
            iArr5[j.q.e(2)] = 1;
            iArr5[j.q.e(1)] = 2;
            iArr5[j.q.e(3)] = 3;
            iArr5[j.q.e(4)] = 4;
            $EnumSwitchMapping$4 = iArr5;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$processNavigation$1", f = "AvatarActivityV2.kt", l = {1435, 1437}, m = "invokeSuspend")
    public static final class b0 extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public int f34758b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34759c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ z0 f34760d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ boolean f34761e;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public b0(AvatarActivityV2 avatarActivityV2, z0 z0Var, boolean z14, ul3.d<? super b0> dVar) {
            super(2, dVar);
            this.f34759c = avatarActivityV2;
            this.f34760d = z0Var;
            this.f34761e = z14;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new b0(this.f34759c, this.f34760d, this.f34761e, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new b0(this.f34759c, this.f34760d, this.f34761e, dVar).invokeSuspend(Unit.INSTANCE);
        }

        /* JADX WARNING: Code restructure failed: missing block: B:124:0x02d6, code lost:
            if (em3.q.b(null, r5.c()) == false) goto L_0x02df;
         */
        /* JADX WARNING: Code restructure failed: missing block: B:138:0x0306, code lost:
            if (em3.q.b(r12, r5.a()) != false) goto L_0x0308;
         */
        /* JADX WARNING: Code restructure failed: missing block: B:139:0x0308, code lost:
            r12 = true;
         */
        /* JADX WARNING: Code restructure failed: missing block: B:161:0x036e, code lost:
            if (r4 == null) goto L_0x0378;
         */
        /* JADX WARNING: Code restructure failed: missing block: B:249:0x0311, code lost:
            continue;
         */
        /* JADX WARNING: Removed duplicated region for block: B:170:0x0389  */
        /* JADX WARNING: Removed duplicated region for block: B:199:0x0447  */
        /* JADX WARNING: Removed duplicated region for block: B:200:0x044e  */
        /* JADX WARNING: Removed duplicated region for block: B:202:0x0479  */
        /* JADX WARNING: Removed duplicated region for block: B:224:0x04c3  */
        /* JADX WARNING: Removed duplicated region for block: B:238:0x0501  */
        /* JADX WARNING: Removed duplicated region for block: B:75:0x01e4  */
        /* JADX WARNING: Removed duplicated region for block: B:78:0x01ed  */
        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            String str;
            String str2;
            AvatarActivityV2 avatarActivityV2;
            s1 s1Var;
            boolean z14;
            uy.z zVar;
            l0 l0Var;
            AvatarActivityV2 avatarActivityV22;
            String str3;
            z0.a aVar;
            T t14;
            float f14;
            boolean z15;
            T t15;
            T t16;
            Integer num;
            vl3.a aVar2;
            h1.b bVar;
            Animator animator;
            s0 s0Var;
            long j14;
            Float f15;
            Pair pair;
            AnimatorSet animatorSet;
            vl3.a aVar3 = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34758b;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                h1 h1Var = (h1) this.f34759c.F.getValue();
                zy.b bVar2 = this.f34759c.f34735j;
                if (bVar2 != null) {
                    RenderTextureView renderTextureView = (RenderTextureView) bVar2.f201664g;
                    em3.q.e(renderTextureView, "binding.avatarRenderView");
                    zy.b bVar3 = this.f34759c.f34735j;
                    if (bVar3 != null) {
                        View view = bVar3.f201660c;
                        em3.q.e(view, "binding.avatarRenderViewPlaceholder");
                        z0.a aVar4 = (z0.a) this.f34760d;
                        Objects.requireNonNull(h1Var);
                        if (aVar4 == null) {
                            bVar = new h1.b(null, false);
                        } else {
                            boolean z16 = aVar4 instanceof z0.a.e;
                            z0.a aVar5 = h1Var.f146792d;
                            boolean z17 = (aVar5 instanceof z0.a.b) || (aVar4 instanceof z0.a.b);
                            if (aVar5 == null) {
                                j14 = 0;
                            } else {
                                j14 = z17 ? 500 : 300;
                            }
                            h1Var.f146792d = aVar4;
                            h1.a aVar6 = h1Var.f146791c;
                            if (aVar6 != null && aVar6.f146794a == z16) {
                                bVar = new h1.b(null, false);
                            } else {
                                if (!z17) {
                                    view.setBackgroundColor(0);
                                }
                                h1Var.f146791c = new h1.a(z16, z17, j14);
                                Animator animator2 = h1Var.f146793e;
                                if (animator2 != null) {
                                    animator2.cancel();
                                }
                                float f16 = 1.0f;
                                if (z16) {
                                    f15 = Float.valueOf(1.0f);
                                    f16 = h1Var.f146789a;
                                } else {
                                    f15 = Float.valueOf(h1Var.f146789a);
                                }
                                Pair pair2 = TuplesKt.to(f15, Float.valueOf(f16));
                                float floatValue = ((Number) pair2.component1()).floatValue();
                                float floatValue2 = ((Number) pair2.component2()).floatValue();
                                if (z16) {
                                    pair = TuplesKt.to(Float.valueOf(0.0f), Float.valueOf(-h1Var.f146790b));
                                } else {
                                    pair = TuplesKt.to(Float.valueOf(-h1Var.f146790b), Float.valueOf(0.0f));
                                }
                                float floatValue3 = ((Number) pair.component1()).floatValue();
                                float floatValue4 = ((Number) pair.component2()).floatValue();
                                aVar2 = aVar3;
                                str = "avatarManager";
                                long j15 = z17 ? 0 : j14;
                                ObjectAnimator ofFloat = ObjectAnimator.ofFloat(renderTextureView, "scaleX", floatValue, floatValue2);
                                ofFloat.setDuration(j15);
                                ObjectAnimator ofFloat2 = ObjectAnimator.ofFloat(renderTextureView, "scaleY", floatValue, floatValue2);
                                ofFloat2.setDuration(j15);
                                ObjectAnimator ofFloat3 = ObjectAnimator.ofFloat(renderTextureView, "translationY", floatValue3, floatValue4);
                                ofFloat3.setDuration(j15);
                                if (z17) {
                                    ObjectAnimator ofFloat4 = ObjectAnimator.ofFloat(renderTextureView, "alpha", 1.0f, 0.0f);
                                    ofFloat4.setDuration(0L);
                                    AnimatorSet animatorSet2 = new AnimatorSet();
                                    animatorSet2.playTogether(ofFloat, ofFloat2, ofFloat3, ofFloat4);
                                    AnimatorSet animatorSet3 = new AnimatorSet();
                                    ObjectAnimator ofFloat5 = ObjectAnimator.ofFloat(renderTextureView, "alpha", 0.0f, 1.0f);
                                    ofFloat5.setDuration(0L);
                                    animatorSet3.play(ofFloat5).after(j14);
                                    animatorSet = new AnimatorSet();
                                    animatorSet.playSequentially(animatorSet2, animatorSet3);
                                } else {
                                    AnimatorSet animatorSet4 = new AnimatorSet();
                                    animatorSet4.playTogether(ofFloat, ofFloat2, ofFloat3);
                                    animatorSet = animatorSet4;
                                }
                                h1Var.f146793e = animatorSet;
                                bVar = new h1.b(animatorSet, z17 || j14 == 0);
                                animator = bVar.f146797a;
                                if (!bVar.f146798b || animator == null) {
                                    if (animator != null) {
                                        animator.start();
                                    }
                                    s0Var = this.f34759c.f34737l;
                                    if (s0Var == null) {
                                        this.f34758b = 1;
                                        if (s0Var.A((z0.a) this.f34760d, this) == aVar2) {
                                            return aVar2;
                                        }
                                    } else {
                                        em3.q.l(str);
                                        throw null;
                                    }
                                } else {
                                    s0 s0Var2 = this.f34759c.f34737l;
                                    if (s0Var2 != null) {
                                        this.f34758b = 2;
                                        if (s0Var2.B((z0.a) this.f34760d, animator, this) == aVar2) {
                                            return aVar2;
                                        }
                                    } else {
                                        em3.q.l(str);
                                        throw null;
                                    }
                                }
                            }
                        }
                        aVar2 = aVar3;
                        str = "avatarManager";
                        animator = bVar.f146797a;
                        if (!bVar.f146798b) {
                        }
                        if (animator != null) {
                        }
                        s0Var = this.f34759c.f34737l;
                        if (s0Var == null) {
                        }
                    } else {
                        em3.q.l("binding");
                        throw null;
                    }
                } else {
                    em3.q.l("binding");
                    throw null;
                }
            } else if (i14 == 1 || i14 == 2) {
                ResultKt.throwOnFailure(obj);
                str = "avatarManager";
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AvatarActivityV2 avatarActivityV23 = this.f34759c;
            z0.a aVar7 = (z0.a) this.f34760d;
            boolean z18 = this.f34761e;
            int i15 = AvatarActivityV2.J;
            Objects.requireNonNull(avatarActivityV23);
            if (aVar7 instanceof z0.a.e) {
                avatarActivityV23.s9();
                l0 l0Var2 = avatarActivityV23.f34736k;
                if (l0Var2 != null) {
                    avatarActivityV23.i9(l0Var2.j6());
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else if (aVar7 instanceof z0.a.c) {
                avatarActivityV23.s9();
                l0 l0Var3 = avatarActivityV23.f34736k;
                if (l0Var3 != null) {
                    Object H = pd3.d.c().H(uf3.a.AVATAR_FOCUS_SET_AS_MAIN_TOOLTIP_SHOWN, Boolean.FALSE);
                    Objects.requireNonNull(H, "null cannot be cast to non-null type kotlin.Boolean");
                    boolean z19 = !((Boolean) H).booleanValue();
                    if (!em3.q.b(l0Var3.D0.getValue(), Boolean.valueOf(z19))) {
                        l0Var3.D0.setValue(Boolean.valueOf(z19));
                    }
                    l0 l0Var4 = avatarActivityV23.f34736k;
                    if (l0Var4 != null) {
                        l0Var4.s6(((z0.a.c) aVar7).f147099f);
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else if (!(aVar7 instanceof z0.a.C2780a)) {
                if (aVar7 instanceof z0.a.d) {
                    z0.a.d dVar = (z0.a.d) aVar7;
                    if (dVar.f147100e) {
                        zVar = avatarActivityV23.f34739n.d();
                    } else {
                        Integer num2 = dVar.f147101f;
                        if (num2 != null) {
                            int intValue = num2.intValue();
                            r0 r0Var = avatarActivityV23.f34739n;
                            l0 l0Var5 = avatarActivityV23.f34736k;
                            if (l0Var5 != null) {
                                zVar = r0Var.e(l0Var5.f146872z, intValue);
                            } else {
                                em3.q.l("viewModel");
                                throw null;
                            }
                        }
                        r0 r0Var2 = avatarActivityV23.f34739n;
                        l0 l0Var6 = avatarActivityV23.f34736k;
                        if (l0Var6 != null) {
                            z14 = true;
                            zVar = r0Var2.b(l0Var6.f146872z, true);
                            l0Var = avatarActivityV23.f34736k;
                            if (l0Var == null) {
                                com.android.billingclient.api.z.m(l0Var.f146848n, l0Var.o6());
                                List<m00.c> value = l0Var.f146848n.getValue();
                                if (value != null) {
                                    Iterator<T> it3 = value.iterator();
                                    while (true) {
                                        if (!it3.hasNext()) {
                                            break;
                                        }
                                        Iterator<T> it4 = it3.next().f109478f.iterator();
                                        while (true) {
                                            if (!it4.hasNext()) {
                                                t14 = null;
                                                break;
                                            }
                                            t14 = it4.next();
                                            T t17 = t14;
                                            if (zVar == null || t17.f109462a != zVar.a()) {
                                                z15 = false;
                                                continue;
                                            } else {
                                                z15 = z14;
                                                continue;
                                            }
                                            if (z15) {
                                                break;
                                            }
                                        }
                                        T t18 = t14;
                                        if (t18 != null) {
                                            o0<m00.b> o0Var = l0Var.f146850o;
                                            if (zVar != null) {
                                                f14 = zVar.e();
                                            } else {
                                                f14 = t18.f109464c;
                                            }
                                            int i16 = t18.f109462a;
                                            String str4 = t18.f109463b;
                                            String str5 = t18.f109465d;
                                            boolean z24 = t18.f109466e;
                                            boolean z25 = t18.f109467f;
                                            String str6 = t18.f109468g;
                                            boolean z26 = t18.f109469h;
                                            avatarActivityV22 = avatarActivityV23;
                                            Integer num3 = t18.f109470i;
                                            aVar = aVar7;
                                            boolean z27 = t18.f109471j;
                                            str2 = "viewModel";
                                            boolean z28 = t18.f109472k;
                                            str3 = "msg";
                                            em3.q.f(str4, "name");
                                            em3.q.f(str5, "thumbnail");
                                            com.android.billingclient.api.z.m(o0Var, new m00.b(i16, str4, f14, str5, z24, z25, str6, z26, num3, z27, z28));
                                            if (t18.f109467f) {
                                                com.android.billingclient.api.z.m(l0Var.f146856r, t18);
                                            }
                                        }
                                    }
                                    o0<m00.c> o0Var2 = l0Var.f146852p;
                                    List<m00.c> value2 = l0Var.f146848n.getValue();
                                    com.android.billingclient.api.z.m(o0Var2, value2 == null ? (m00.c) ql3.u.R(value2) : null);
                                    em3.q.f("[initGestureList] gesture: " + zVar + ", selected: " + l0Var.f146850o.getValue(), str3);
                                    avatarActivityV2 = avatarActivityV22;
                                    aVar7 = aVar;
                                }
                                avatarActivityV22 = avatarActivityV23;
                                aVar = aVar7;
                                str2 = "viewModel";
                                str3 = "msg";
                                o0<m00.c> o0Var22 = l0Var.f146852p;
                                List<m00.c> value22 = l0Var.f146848n.getValue();
                                com.android.billingclient.api.z.m(o0Var22, value22 == null ? (m00.c) ql3.u.R(value22) : null);
                                em3.q.f("[initGestureList] gesture: " + zVar + ", selected: " + l0Var.f146850o.getValue(), str3);
                                avatarActivityV2 = avatarActivityV22;
                                aVar7 = aVar;
                            } else {
                                em3.q.l("viewModel");
                                throw null;
                            }
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    }
                    z14 = true;
                    l0Var = avatarActivityV23.f34736k;
                    if (l0Var == null) {
                    }
                } else {
                    str2 = "viewModel";
                    if (aVar7 instanceof z0.a.b) {
                        avatarActivityV23.Q8();
                        avatarActivityV23.P8();
                        if (z18) {
                            avatarActivityV2 = avatarActivityV23;
                            l0 l0Var7 = avatarActivityV2.f34736k;
                            if (l0Var7 != null) {
                                uz.t value3 = l0Var7.G.getValue();
                                if (value3 != null) {
                                    s0 s0Var3 = avatarActivityV2.f34737l;
                                    if (s0Var3 != null) {
                                        s0Var3.z(value3.d(), false);
                                    } else {
                                        em3.q.l(str);
                                        throw null;
                                    }
                                }
                            } else {
                                em3.q.l(str2);
                                throw null;
                            }
                        }
                    }
                    avatarActivityV2 = avatarActivityV23;
                }
                if (aVar7.f147090d) {
                    uy.y c14 = avatarActivityV2.f34739n.c();
                    l0 l0Var8 = avatarActivityV2.f34736k;
                    if (l0Var8 != null) {
                        um3.g.d(j2.e.g(l0Var8), null, 0, new sz.d0(avatarActivityV2, c14, null), 3, null);
                        l0 l0Var9 = avatarActivityV2.f34736k;
                        if (l0Var9 == null) {
                            em3.q.l(str2);
                            throw null;
                        } else if (!l0Var9.p6()) {
                            s1Var = null;
                            avatarActivityV2.m9(null);
                            this.f34759c.f34745t = s1Var;
                            return Unit.INSTANCE;
                        }
                    } else {
                        em3.q.l(str2);
                        throw null;
                    }
                }
                s1Var = null;
                this.f34759c.f34745t = s1Var;
                return Unit.INSTANCE;
            } else if (!z18) {
                l0 l0Var10 = avatarActivityV23.f34736k;
                if (l0Var10 != null) {
                    uy.y c15 = avatarActivityV23.f34739n.c();
                    com.android.billingclient.api.z.m(l0Var10.f146842k, l0Var10.n6());
                    o0<m00.a> o0Var3 = l0Var10.f146844l;
                    List<m00.a> value4 = l0Var10.f146842k.getValue();
                    if (value4 != null) {
                        Iterator<T> it5 = value4.iterator();
                        while (true) {
                            if (!it5.hasNext()) {
                                t16 = null;
                                break;
                            }
                            t16 = it5.next();
                            T t19 = t16;
                            if ((c15 != null ? c15.c() : null) != null) {
                                em3.q.f(t19, "<this>");
                                if (!(t19 instanceof a.b)) {
                                    if (!(t19 instanceof a.C1778a)) {
                                        throw new NoWhenBranchMatchedException();
                                    }
                                }
                            }
                            if ((c15 != null ? c15.a() : null) != null) {
                                em3.q.f(t19, "<this>");
                                if (t19 instanceof a.b) {
                                    num = null;
                                } else if (t19 instanceof a.C1778a) {
                                    num = Integer.valueOf(t19.f109455b);
                                } else {
                                    throw new NoWhenBranchMatchedException();
                                }
                            }
                            boolean z29 = false;
                            continue;
                            if (z29) {
                                break;
                            }
                        }
                        t15 = t16;
                    } else {
                        t15 = null;
                    }
                    com.android.billingclient.api.z.m(o0Var3, t15);
                    em3.q.f("[initBackgroundList] background: " + c15 + ", selected: " + l0Var10.f146844l.getValue(), "msg");
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
            avatarActivityV2 = avatarActivityV23;
            str2 = "viewModel";
            if (aVar7.f147090d) {
            }
            s1Var = null;
            this.f34759c.f34745t = s1Var;
            return Unit.INSTANCE;
        }
    }

    public static final class c extends em3.s implements dm3.a<b00.a> {

        /* renamed from: b  reason: collision with root package name */
        public static final c f34762b = new c();

        public c() {
            super(0);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public b00.a invoke() {
            return new b00.a();
        }
    }

    public static final class c0 extends em3.s implements dm3.a<h1> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34763b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public c0(AvatarActivityV2 avatarActivityV2) {
            super(0);
            this.f34763b = avatarActivityV2;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public h1 invoke() {
            AvatarActivityV2 avatarActivityV2 = this.f34763b;
            int i14 = AvatarActivityV2.J;
            Objects.requireNonNull(avatarActivityV2);
            float f14 = (float) rz.l.e(avatarActivityV2).x;
            float dimension = (f14 - (avatarActivityV2.getResources().getDimension(R.dimen.avatar_normal_view_bg_hole_left_margin) * ((float) 2))) / f14;
            AvatarActivityV2 avatarActivityV22 = this.f34763b;
            Objects.requireNonNull(avatarActivityV22);
            float f15 = (float) rz.l.e(avatarActivityV22).y;
            float f16 = f15 - (dimension * f15);
            return new h1(dimension, (avatarActivityV22.getResources().getDimension(R.dimen.avatar_normal_view_bg_hole_bottom_margin) - f16) - avatarActivityV22.getResources().getDimension(R.dimen.avatar_main_background_margin_bottom));
        }
    }

    public static final class d extends em3.s implements dm3.a<g1> {

        /* renamed from: b  reason: collision with root package name */
        public static final d f34764b = new d();

        public d() {
            super(0);
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public g1 invoke() {
            return new g1();
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$setContent$1", f = "AvatarActivityV2.kt", l = {1654}, m = "invokeSuspend")
    public static final class d0 extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public int f34765b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34766c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ jr2.d f34767d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ dm3.l<Boolean, Unit> f34768e;

        /* JADX DEBUG: Multi-variable search result rejected for r3v0, resolved type: dm3.l<? super java.lang.Boolean, kotlin.Unit> */
        /* JADX WARN: Multi-variable type inference failed */
        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public d0(AvatarActivityV2 avatarActivityV2, jr2.d dVar, dm3.l<? super Boolean, Unit> lVar, ul3.d<? super d0> dVar2) {
            super(2, dVar2);
            this.f34766c = avatarActivityV2;
            this.f34767d = dVar;
            this.f34768e = lVar;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new d0(this.f34766c, this.f34767d, this.f34768e, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new d0(this.f34766c, this.f34767d, this.f34768e, dVar).invokeSuspend(Unit.INSTANCE);
        }

        /* JADX WARNING: Removed duplicated region for block: B:19:0x0061  */
        /* JADX WARNING: Removed duplicated region for block: B:24:0x0078  */
        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34765b;
            boolean z14 = true;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                s0 s0Var = this.f34766c.f34737l;
                if (s0Var != null) {
                    if (!s0Var.f146959b.F(this.f34767d.b())) {
                        l0 l0Var = this.f34766c.f34736k;
                        if (l0Var != null) {
                            l0Var.I6(this.f34767d.b(), new Integer(1));
                            s0 s0Var2 = this.f34766c.f34737l;
                            if (s0Var2 != null) {
                                int b14 = this.f34767d.b();
                                this.f34765b = 1;
                                obj = s0Var2.f(b14, null, this);
                                if (obj == aVar) {
                                    return aVar;
                                }
                            } else {
                                em3.q.l("avatarManager");
                                throw null;
                            }
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    }
                    if (!z14) {
                        s0 s0Var3 = this.f34766c.f34737l;
                        if (s0Var3 != null) {
                            s0Var3.w(this.f34767d);
                            this.f34768e.invoke(Boolean.TRUE);
                        } else {
                            em3.q.l("avatarManager");
                            throw null;
                        }
                    } else {
                        this.f34768e.invoke(Boolean.FALSE);
                    }
                    return Unit.INSTANCE;
                }
                em3.q.l("avatarManager");
                throw null;
            } else if (i14 == 1) {
                ResultKt.throwOnFailure(obj);
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            z14 = ((Boolean) obj).booleanValue();
            if (!z14) {
            }
            return Unit.INSTANCE;
        }
    }

    public static final class e extends em3.s implements dm3.a<p00.h> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34769b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public e(AvatarActivityV2 avatarActivityV2) {
            super(0);
            this.f34769b = avatarActivityV2;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public p00.h invoke() {
            AvatarActivityV2 avatarActivityV2 = this.f34769b;
            int i14 = AvatarActivityV2.J;
            return new p00.h(avatarActivityV2.K8());
        }
    }

    public static final class e0 extends em3.s implements dm3.l<Boolean, Unit> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34770b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public e0(AvatarActivityV2 avatarActivityV2) {
            super(1);
            this.f34770b = avatarActivityV2;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // dm3.l
        public Unit invoke(Boolean bool) {
            if (!bool.booleanValue()) {
                rz.i.d(rz.i.f140915a, this.f34770b, R.string.avatar_edit_toast_unabletodisplay, 0, 0, 0, 0, false, 124);
            }
            return Unit.INSTANCE;
        }
    }

    public static final class f extends em3.s implements dm3.a<Unit> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34771b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public f(AvatarActivityV2 avatarActivityV2) {
            super(0);
            this.f34771b = avatarActivityV2;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public Unit invoke() {
            AvatarActivityV2 avatarActivityV2 = this.f34771b;
            int i14 = AvatarActivityV2.J;
            avatarActivityV2.I8();
            return Unit.INSTANCE;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$setHomeGesture$1", f = "AvatarActivityV2.kt", l = {1198}, m = "invokeSuspend")
    public static final class f0 extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public int f34772b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34773c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ uy.z f34774d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ dm3.a<Unit> f34775e;

        /* renamed from: f  reason: collision with root package name */
        public final /* synthetic */ z0.a f34776f;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public f0(AvatarActivityV2 avatarActivityV2, uy.z zVar, dm3.a<Unit> aVar, z0.a aVar2, ul3.d<? super f0> dVar) {
            super(2, dVar);
            this.f34773c = avatarActivityV2;
            this.f34774d = zVar;
            this.f34775e = aVar;
            this.f34776f = aVar2;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new f0(this.f34773c, this.f34774d, this.f34775e, this.f34776f, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new f0(this.f34773c, this.f34774d, this.f34775e, this.f34776f, dVar).invokeSuspend(Unit.INSTANCE);
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34772b;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                s1 s1Var = this.f34773c.f34750y;
                if (s1Var != null) {
                    this.f34772b = 1;
                    if (s1Var.m(this) == aVar) {
                        return aVar;
                    }
                }
            } else if (i14 == 1) {
                ResultKt.throwOnFailure(obj);
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            uy.z zVar = this.f34774d;
            if (zVar != null) {
                AvatarActivityV2 avatarActivityV2 = this.f34773c;
                z0.a aVar2 = this.f34776f;
                s0 s0Var = avatarActivityV2.f34737l;
                if (s0Var != null) {
                    s0Var.F(aVar2.f147088b);
                    s0 s0Var2 = avatarActivityV2.f34737l;
                    if (s0Var2 != null) {
                        s0Var2.w(new jr2.d(zVar.a(), jr2.e.gesture, new jr2.i(-1, jr2.a.lastFrame, null, false, 0, 28), null, null, 0, 56));
                        s0 s0Var3 = avatarActivityV2.f34737l;
                        if (s0Var3 != null) {
                            s0Var3.s(zVar.e());
                            AvatarActivityV2.D8(avatarActivityV2, zVar.a());
                        } else {
                            em3.q.l("avatarManager");
                            throw null;
                        }
                    } else {
                        em3.q.l("avatarManager");
                        throw null;
                    }
                } else {
                    em3.q.l("avatarManager");
                    throw null;
                }
            }
            s0 s0Var4 = this.f34773c.f34737l;
            if (s0Var4 != null) {
                s0Var4.y(true);
                AvatarActivityV2 avatarActivityV22 = this.f34773c;
                StringBuilder a14 = b.d.a("setHomeGesture gesture: ");
                a14.append(this.f34774d);
                AvatarActivityV2.z8(avatarActivityV22, a14.toString());
                dm3.a<Unit> aVar3 = this.f34775e;
                if (aVar3 != null) {
                    aVar3.invoke();
                }
                return Unit.INSTANCE;
            }
            em3.q.l("avatarManager");
            throw null;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$doneAvatarCustomization$2", f = "AvatarActivityV2.kt", l = {3297}, m = "invokeSuspend")
    public static final class g extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public Object f34777b;

        /* renamed from: c  reason: collision with root package name */
        public int f34778c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34779d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ boolean f34780e;

        /* renamed from: f  reason: collision with root package name */
        public final /* synthetic */ um3.r<a> f34781f;

        @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$doneAvatarCustomization$2$changeAfterInfo$1", f = "AvatarActivityV2.kt", l = {3297}, m = "invokeSuspend")
        public static final class a extends wl3.i implements dm3.p<um3.h0, ul3.d<? super a>, Object> {

            /* renamed from: b  reason: collision with root package name */
            public int f34782b;

            /* renamed from: c  reason: collision with root package name */
            public final /* synthetic */ um3.r<a> f34783c;

            /* JADX INFO: super call moved to the top of the method (can break code semantics) */
            public a(um3.r<a> rVar, ul3.d<? super a> dVar) {
                super(2, dVar);
                this.f34783c = rVar;
            }

            @Override // wl3.a
            public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
                return new a(this.f34783c, dVar);
            }

            /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
            @Override // dm3.p
            public Object invoke(um3.h0 h0Var, ul3.d<? super a> dVar) {
                return new a(this.f34783c, dVar).invokeSuspend(Unit.INSTANCE);
            }

            @Override // wl3.a
            public final Object invokeSuspend(Object obj) {
                vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
                int i14 = this.f34782b;
                if (i14 == 0) {
                    ResultKt.throwOnFailure(obj);
                    um3.r<a> rVar = this.f34783c;
                    this.f34782b = 1;
                    obj = rVar.K(this);
                    if (obj == aVar) {
                        return aVar;
                    }
                } else if (i14 == 1) {
                    ResultKt.throwOnFailure(obj);
                } else {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                return obj;
            }
        }

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public g(AvatarActivityV2 avatarActivityV2, boolean z14, um3.r<a> rVar, ul3.d<? super g> dVar) {
            super(2, dVar);
            this.f34779d = avatarActivityV2;
            this.f34780e = z14;
            this.f34781f = rVar;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new g(this.f34779d, this.f34780e, this.f34781f, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new g(this.f34779d, this.f34780e, this.f34781f, dVar).invokeSuspend(Unit.INSTANCE);
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            Object obj2;
            String str;
            int i14;
            boolean z14;
            er2.g gVar;
            YukiEffectService yukiEffectService;
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i15 = this.f34778c;
            boolean z15 = true;
            z0 z0Var = null;
            if (i15 == 0) {
                ResultKt.throwOnFailure(obj);
                l0 l0Var = this.f34779d.f34736k;
                if (l0Var != null) {
                    String str2 = l0Var.U5().f34545k;
                    if (str2 != null) {
                        this.f34779d.t9(false);
                    } else {
                        AvatarActivityV2.F8(this.f34779d);
                    }
                    s0 s0Var = this.f34779d.f34737l;
                    if (s0Var != null) {
                        gr2.m mVar = gr2.m.AvatarVisibleModeAppearanceModify;
                        em3.q.f(mVar, "avatarVisibleMode");
                        gr2.o oVar = s0Var.f146959b;
                        boolean J = oVar.J("doneAvatarVisibleMode");
                        StringBuilder sb4 = new StringBuilder();
                        sb4.append("doneAvatarVisibleMode() mode:");
                        sb4.append(mVar);
                        sb4.append(" scriptReady:");
                        sz.g.a(sb4, !J, oVar);
                        if (!(J || (gVar = oVar.f77697k) == null || (yukiEffectService = gVar.f69145a) == null)) {
                            yukiEffectService.doneAvatarVisibleMode(mVar.d());
                        }
                        um3.c0 c0Var = w0.f166205b;
                        a aVar2 = new a(this.f34781f, null);
                        this.f34777b = str2;
                        this.f34778c = 1;
                        obj2 = um3.g.g(c0Var, aVar2, this);
                        if (obj2 == aVar) {
                            return aVar;
                        }
                        str = str2;
                    } else {
                        em3.q.l("avatarManager");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else if (i15 == 1) {
                str = (String) this.f34777b;
                ResultKt.throwOnFailure(obj);
                obj2 = obj;
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            a aVar3 = (a) obj2;
            if (str != null) {
                String str3 = aVar3.f34753b;
                String str4 = aVar3.f34754c;
                AvatarActivityV2 avatarActivityV2 = this.f34779d;
                Map<String, String> j14 = ql3.g0.j(TuplesKt.to("avatarId", str3), TuplesKt.to("avatarHash", str4));
                int i16 = AvatarActivityV2.J;
                avatarActivityV2.V8(str, j14);
                this.f34779d.J8();
            } else {
                String str5 = aVar3.f34752a;
                if (str5 != null) {
                    AvatarActivityV2 avatarActivityV22 = this.f34779d;
                    int i17 = AvatarActivityV2.J;
                    avatarActivityV22.i9(str5);
                    l0 l0Var2 = avatarActivityV22.f34736k;
                    if (l0Var2 != null) {
                        l0Var2.f146843k0 = true;
                        o0<List<m00.d>> o0Var = l0Var2.f146836h;
                        com.android.billingclient.api.z.m(o0Var, o0Var.getValue());
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                }
                AvatarActivityV2 avatarActivityV23 = this.f34779d;
                z0.a.c cVar = new z0.a.c(null, false, 3);
                boolean z16 = aVar3.f34752a != null && this.f34780e;
                l0 l0Var3 = avatarActivityV23.f34736k;
                if (l0Var3 != null) {
                    List<z0> list = l0Var3.f146832f;
                    ListIterator<z0> listIterator = list.listIterator(list.size());
                    while (true) {
                        if (!listIterator.hasPrevious()) {
                            i14 = -1;
                            break;
                        }
                        z0 previous = listIterator.previous();
                        if ((previous instanceof z0.a.e) || (previous instanceof z0.a.c)) {
                            z14 = true;
                            continue;
                        } else {
                            z14 = false;
                            continue;
                        }
                        if (z14) {
                            i14 = listIterator.nextIndex();
                            break;
                        }
                    }
                    Integer valueOf = Integer.valueOf(i14);
                    if (!(valueOf.intValue() >= 0)) {
                        valueOf = null;
                    }
                    if (valueOf != null) {
                        int intValue = valueOf.intValue();
                        z0 z0Var2 = l0Var3.f146832f.get(intValue);
                        List J0 = ql3.u.J0(l0Var3.f146832f.subList(0, intValue + 1));
                        l0Var3.f146832f.clear();
                        l0Var3.f146832f.addAll(J0);
                        if (z0Var2 instanceof z0.a) {
                            l0Var3.D6((z0.a) z0Var2);
                        }
                        StringBuilder sb5 = new StringBuilder();
                        sb5.append("navigateBackMainOrFocusView() last:");
                        sb5.append(z0Var2);
                        sb5.append(" stack:");
                        ay.g.a(sb5, ql3.u.Z(l0Var3.f146832f, null, null, null, 0, null, null, 63), "msg");
                        z0Var = z0Var2;
                    }
                    if (z16) {
                        if (z0Var != null) {
                            z15 = false;
                        }
                        avatarActivityV23.X8(cVar, z15);
                    } else if (z0Var == null) {
                        avatarActivityV23.X8(cVar, true);
                    } else {
                        avatarActivityV23.g9(z0Var, true);
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
            return Unit.INSTANCE;
        }
    }

    public static final class g0 extends em3.s implements dm3.a<Unit> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34784b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public g0(AvatarActivityV2 avatarActivityV2) {
            super(0);
            this.f34784b = avatarActivityV2;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public Unit invoke() {
            AvatarActivityV2 avatarActivityV2 = this.f34784b;
            int i14 = AvatarActivityV2.J;
            avatarActivityV2.J8();
            return Unit.INSTANCE;
        }
    }

    public static final class h extends em3.s implements dm3.a<q2.e> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34785b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public h(AvatarActivityV2 avatarActivityV2) {
            super(0);
            this.f34785b = avatarActivityV2;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public q2.e invoke() {
            return new q2.e(this.f34785b, new a(this.f34785b));
        }
    }

    public static final class h0 extends em3.s implements dm3.l<Boolean, Unit> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34786b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public h0(AvatarActivityV2 avatarActivityV2) {
            super(1);
            this.f34786b = avatarActivityV2;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // dm3.l
        public Unit invoke(Boolean bool) {
            if (bool.booleanValue()) {
                AvatarActivityV2.Y8(this.f34786b, new z0.a.e(null, 1), false, 2);
            } else {
                AvatarActivityV2 avatarActivityV2 = this.f34786b;
                int i14 = AvatarActivityV2.J;
                avatarActivityV2.J8();
            }
            return Unit.INSTANCE;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$handleExport$1", f = "AvatarActivityV2.kt", l = {2165, 2168, 2168}, m = "invokeSuspend")
    public static final class i extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public boolean f34787b;

        /* renamed from: c  reason: collision with root package name */
        public int f34788c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34789d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ i0 f34790e;

        /* renamed from: f  reason: collision with root package name */
        public final /* synthetic */ i0 f34791f;

        /* renamed from: g  reason: collision with root package name */
        public final /* synthetic */ String f34792g;

        /* renamed from: h  reason: collision with root package name */
        public final /* synthetic */ r00.b f34793h;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public i(AvatarActivityV2 avatarActivityV2, i0 i0Var, i0 i0Var2, String str, r00.b bVar, ul3.d<? super i> dVar) {
            super(2, dVar);
            this.f34789d = avatarActivityV2;
            this.f34790e = i0Var;
            this.f34791f = i0Var2;
            this.f34792g = str;
            this.f34793h = bVar;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new i(this.f34789d, this.f34790e, this.f34791f, this.f34792g, this.f34793h, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new i(this.f34789d, this.f34790e, this.f34791f, this.f34792g, this.f34793h, dVar).invokeSuspend(Unit.INSTANCE);
        }

        /* JADX WARNING: Removed duplicated region for block: B:47:0x0162  */
        /* JADX WARNING: Removed duplicated region for block: B:63:0x01bd  */
        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            Object obj2;
            boolean z14;
            boolean z15;
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34788c;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                uy.z d14 = this.f34789d.f34739n.d();
                z15 = em3.q.b(d14 != null ? d14.c() : null, r0.a.Video.d());
                l0 l0Var = this.f34789d.f34736k;
                if (l0Var != null) {
                    l0Var.Y6(new m00.g(null, null));
                    zy.b bVar = this.f34789d.f34735j;
                    if (bVar != null) {
                        RenderTextureView renderTextureView = (RenderTextureView) bVar.f201664g;
                        em3.q.e(renderTextureView, "binding.avatarRenderView");
                        com.android.billingclient.api.e0.u(renderTextureView, this.f34790e.f68710b, this.f34791f.f68710b);
                        this.f34787b = z15;
                        this.f34788c = 1;
                        if (um3.r0.b(300, this) == aVar) {
                            return aVar;
                        }
                    } else {
                        em3.q.l("binding");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else if (i14 == 1) {
                z15 = this.f34787b;
                ResultKt.throwOnFailure(obj);
            } else if (i14 == 2 || i14 == 3) {
                z14 = this.f34787b;
                ResultKt.throwOnFailure(obj);
                obj2 = obj;
                if (!((Boolean) obj2).booleanValue()) {
                    l0 l0Var2 = this.f34789d.f34736k;
                    if (l0Var2 != null) {
                        s1 s1Var = l0Var2.f146841j0;
                        if (s1Var != null) {
                            s1Var.c(null);
                        }
                        l0Var2.f146841j0 = null;
                        m00.g value = l0Var2.f146839i0.getValue();
                        Integer num = value != null ? value.f109489b : null;
                        l0Var2.Y6(new m00.g(num, num));
                        bz.c K8 = this.f34789d.K8();
                        AvatarActivityV2 avatarActivityV2 = this.f34789d;
                        Uri fromFile = Uri.fromFile(new File(this.f34792g));
                        em3.q.e(fromFile, "fromFile(File(filePath))");
                        boolean z16 = !z14;
                        l0 l0Var3 = this.f34789d.f34736k;
                        if (l0Var3 != null) {
                            K8.H(avatarActivityV2, fromFile, z16, l0Var3.k6(), this.f34793h);
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    rz.i.d(rz.i.f140915a, this.f34789d, R.string.avatar_error_toast_cropviewerfail, 0, 0, 0, 0, false, 124);
                }
                return Unit.INSTANCE;
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            s0 s0Var = this.f34789d.f34737l;
            if (s0Var != null) {
                s0Var.F(cz.n.f61983b);
                if (z15) {
                    AvatarActivityV2 avatarActivityV22 = this.f34789d;
                    String str = this.f34792g;
                    this.f34787b = z15;
                    this.f34788c = 2;
                    s0 s0Var2 = avatarActivityV22.f34737l;
                    if (s0Var2 != null) {
                        sz.h hVar = new sz.h(avatarActivityV22);
                        um3.l lVar = new um3.l(vl3.f.b(this), 1);
                        lVar.q();
                        gr2.f fVar = s0Var2.f146959b.f77708p0;
                        if (fVar != null) {
                            fVar.f77644d = str;
                            fVar.f77650j = true;
                            v0 v0Var = new v0(lVar, s0Var2, hVar);
                            jr2.d dVar = new jr2.d(0, null, null, null, null, 0, 63);
                            dVar.d(new jr2.i(1, null, null, false, 0, 30));
                            fVar.d(v0Var, dVar);
                        }
                        lVar.s(new sz.w0(s0Var2));
                        obj2 = lVar.p();
                        if (obj2 == aVar) {
                            return aVar;
                        }
                    } else {
                        em3.q.l("avatarManager");
                        throw null;
                    }
                } else {
                    AvatarActivityV2 avatarActivityV23 = this.f34789d;
                    String str2 = this.f34792g;
                    this.f34787b = z15;
                    this.f34788c = 3;
                    l0 l0Var4 = avatarActivityV23.f34736k;
                    if (l0Var4 != null) {
                        l0Var4.f146841j0 = um3.g.d(j2.e.g(l0Var4), null, 0, new sz.o0(5, new i0(), 5, l0Var4, 100, null), 3, null);
                        s0 s0Var3 = avatarActivityV23.f34737l;
                        if (s0Var3 != null) {
                            um3.l lVar2 = new um3.l(vl3.f.b(this), 1);
                            lVar2.q();
                            gr2.a aVar2 = s0Var3.f146959b.f77710q0;
                            if (aVar2 != null) {
                                aVar2.f77629a = str2;
                                aVar2.b(new u0(lVar2, s0Var3));
                            }
                            obj2 = lVar2.p();
                            if (obj2 == aVar) {
                                return aVar;
                            }
                        } else {
                            em3.q.l("avatarManager");
                            throw null;
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                }
                z14 = z15;
                if (!((Boolean) obj2).booleanValue()) {
                }
                return Unit.INSTANCE;
            }
            em3.q.l("avatarManager");
            throw null;
        }
    }

    public static final class j extends em3.s implements dm3.l<Throwable, Unit> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34794b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ float[] f34795c;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public j(AvatarActivityV2 avatarActivityV2, float[] fArr) {
            super(1);
            this.f34794b = avatarActivityV2;
            this.f34795c = fArr;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // dm3.l
        public Unit invoke(Throwable th4) {
            l0 l0Var = this.f34794b.f34736k;
            if (l0Var != null) {
                um3.g.d(j2.e.g(l0Var), null, 0, new b(this.f34794b, this.f34795c, null), 3, null);
                this.f34794b.f34749x = null;
                return Unit.INSTANCE;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    public static final class k extends em3.s implements dm3.a<Unit> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34796b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ long f34797c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ dm3.a<Unit> f34798d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public k(AvatarActivityV2 avatarActivityV2, long j14, dm3.a<Unit> aVar) {
            super(0);
            this.f34796b = avatarActivityV2;
            this.f34797c = j14;
            this.f34798d = aVar;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public Unit invoke() {
            l0 l0Var = this.f34796b.f34736k;
            if (l0Var != null) {
                um3.g.d(j2.e.g(l0Var), null, 0, new c(this.f34797c, this.f34796b, this.f34798d, null), 3, null);
                return Unit.INSTANCE;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$launchProfileCamera$1", f = "AvatarActivityV2.kt", l = {}, m = "invokeSuspend")
    public static final class l extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34799b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ String f34800c;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public l(AvatarActivityV2 avatarActivityV2, String str, ul3.d<? super l> dVar) {
            super(2, dVar);
            this.f34799b = avatarActivityV2;
            this.f34800c = str;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new l(this.f34799b, this.f34800c, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new l(this.f34799b, this.f34800c, dVar).invokeSuspend(Unit.INSTANCE);
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            Integer a14;
            ResultKt.throwOnFailure(obj);
            AvatarActivityV2 avatarActivityV2 = this.f34799b;
            int i14 = AvatarActivityV2.J;
            bz.c K8 = avatarActivityV2.K8();
            AvatarActivityV2 avatarActivityV22 = this.f34799b;
            l0 l0Var = avatarActivityV22.f34736k;
            if (l0Var != null) {
                String str = l0Var.f146838i;
                uy.z d14 = avatarActivityV22.f34739n.d();
                Integer num = d14 != null ? new Integer(d14.a()) : null;
                uy.y c14 = this.f34799b.f34739n.c();
                try {
                    this.f34799b.C.a(K8.F(avatarActivityV22, str, num, (c14 == null || (a14 = c14.a()) == null) ? null : a14.toString(), this.f34800c), null);
                } catch (Exception e14) {
                    AvatarActivityV2 avatarActivityV23 = this.f34799b;
                    AvatarActivityV2.z8(avatarActivityV23, "launchProfileCamera() ex:" + e14);
                }
                return Unit.INSTANCE;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$onAvatarBackgroundSave$1", f = "AvatarActivityV2.kt", l = {2705}, m = "invokeSuspend")
    public static final class m extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public Object f34801b;

        /* renamed from: c  reason: collision with root package name */
        public int f34802c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ m00.a f34803d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34804e;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public m(m00.a aVar, AvatarActivityV2 avatarActivityV2, ul3.d<? super m> dVar) {
            super(2, dVar);
            this.f34803d = aVar;
            this.f34804e = avatarActivityV2;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new m(this.f34803d, this.f34804e, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new m(this.f34803d, this.f34804e, dVar).invokeSuspend(Unit.INSTANCE);
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            String str;
            Integer num;
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34802c;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                m00.a aVar2 = this.f34803d;
                String str2 = aVar2 instanceof a.C1778a ? ((a.C1778a) aVar2).f109456c : "";
                AvatarActivityV2 avatarActivityV2 = this.f34804e;
                int i15 = AvatarActivityV2.J;
                avatarActivityV2.t9(false);
                AvatarActivityV2 avatarActivityV22 = this.f34804e;
                r0 r0Var = avatarActivityV22.f34739n;
                m00.a aVar3 = this.f34803d;
                em3.q.f(aVar3, "<this>");
                if (aVar3 instanceof a.b) {
                    num = null;
                } else if (aVar3 instanceof a.C1778a) {
                    num = Integer.valueOf(((a.C1778a) aVar3).f109455b);
                } else {
                    throw new NoWhenBranchMatchedException();
                }
                this.f34801b = str2;
                this.f34802c = 1;
                Object i16 = r0Var.i(avatarActivityV22, num, this);
                if (i16 == aVar) {
                    return aVar;
                }
                str = str2;
                obj = i16;
            } else if (i14 == 1) {
                ResultKt.throwOnFailure(obj);
                str = (String) this.f34801b;
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            boolean booleanValue = ((Boolean) obj).booleanValue();
            l0 l0Var = this.f34804e.f34736k;
            if (l0Var != null) {
                r00.g gVar = r00.g.BACKGROUND;
                r00.c cVar = r00.c.DONE;
                r00.e eVar = r00.e.BACKGROUND;
                YukiStickerCategory V5 = l0Var.V5();
                r00.d dVar = new r00.d(eVar, V5 != null ? V5.getTitle() : null, null, null, null, null, str);
                l0 l0Var2 = this.f34804e.f34736k;
                if (l0Var2 != null) {
                    l0Var.x6(gVar, cVar, dVar, l0Var2.m6());
                    this.f34804e.R8();
                    if (booleanValue) {
                        AvatarActivityV2 avatarActivityV23 = this.f34804e;
                        l0 l0Var3 = avatarActivityV23.f34736k;
                        if (l0Var3 != null) {
                            l0Var3.L6(avatarActivityV23.f34739n.f146931a);
                            this.f34804e.Z8();
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    } else {
                        rz.i.d(rz.i.f140915a, this.f34804e, R.string.avatar_error_toast_cropviewerfail, 0, 0, 0, 0, false, 124);
                    }
                    return Unit.INSTANCE;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    public static final class n extends em3.s implements dm3.l<Boolean, Unit> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34805b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ m00.a f34806c;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public n(AvatarActivityV2 avatarActivityV2, m00.a aVar) {
            super(1);
            this.f34805b = avatarActivityV2;
            this.f34806c = aVar;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // dm3.l
        public Unit invoke(Boolean bool) {
            if (bool.booleanValue()) {
                l0 l0Var = this.f34805b.f34736k;
                if (l0Var != null) {
                    m00.a aVar = this.f34806c;
                    em3.q.f(aVar, "item");
                    com.android.billingclient.api.z.m(l0Var.f146844l, aVar);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                rz.i.d(rz.i.f140915a, this.f34805b, R.string.avatar_edit_toast_unabletodisplay, 0, 0, 0, 0, false, 124);
            }
            l0 l0Var2 = this.f34805b.f34736k;
            if (l0Var2 != null) {
                r00.g gVar = r00.g.BACKGROUND;
                r00.c cVar = r00.c.PLAY;
                r00.e eVar = r00.e.BACKGROUND;
                YukiStickerCategory V5 = l0Var2.V5();
                r00.d dVar = new r00.d(eVar, V5 != null ? V5.getTitle() : null, null, null, null, null, ((a.C1778a) this.f34806c).f109456c);
                l0 l0Var3 = this.f34805b.f34736k;
                if (l0Var3 != null) {
                    l0Var2.x6(gVar, cVar, dVar, l0Var3.m6());
                    return Unit.INSTANCE;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$onAvatarGestureAddFriend$1", f = "AvatarActivityV2.kt", l = {2865}, m = "invokeSuspend")
    public static final class o extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public int f34807b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ m00.b f34808c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34809d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ m00.c f34810e;

        public static final class a extends em3.s implements dm3.l<Boolean, Unit> {

            /* renamed from: b  reason: collision with root package name */
            public final /* synthetic */ AvatarActivityV2 f34811b;

            /* renamed from: c  reason: collision with root package name */
            public final /* synthetic */ m00.b f34812c;

            /* renamed from: d  reason: collision with root package name */
            public final /* synthetic */ m00.c f34813d;

            /* JADX INFO: super call moved to the top of the method (can break code semantics) */
            public a(AvatarActivityV2 avatarActivityV2, m00.b bVar, m00.c cVar) {
                super(1);
                this.f34811b = avatarActivityV2;
                this.f34812c = bVar;
                this.f34813d = cVar;
            }

            /* Return type fixed from 'java.lang.Object' to match base method */
            /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
            @Override // dm3.l
            public Unit invoke(Boolean bool) {
                if (bool.booleanValue()) {
                    l0 l0Var = this.f34811b.f34736k;
                    if (l0Var != null) {
                        com.android.billingclient.api.z.m(l0Var.f146850o, this.f34812c);
                        s0 s0Var = this.f34811b.f34737l;
                        if (s0Var != null) {
                            s0Var.s(0.0f);
                            AvatarActivityV2.D8(this.f34811b, this.f34812c.f109462a);
                        } else {
                            em3.q.l("avatarManager");
                            throw null;
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    rz.i.d(rz.i.f140915a, this.f34811b, R.string.avatar_edit_toast_unabletodisplay, 0, 0, 0, 0, false, 124);
                }
                l0 l0Var2 = this.f34811b.f34736k;
                if (l0Var2 != null) {
                    r00.g gVar = r00.g.GESTURE;
                    r00.c cVar = r00.c.PLAY;
                    r00.e eVar = r00.e.GESTURE;
                    m00.c cVar2 = this.f34813d;
                    r00.d dVar = new r00.d(eVar, cVar2 != null ? cVar2.f109475c : null, null, null, null, this.f34812c.f109463b, null);
                    l0 l0Var3 = this.f34811b.f34736k;
                    if (l0Var3 != null) {
                        l0Var2.x6(gVar, cVar, dVar, l0Var3.m6());
                        return Unit.INSTANCE;
                    }
                    em3.q.l("viewModel");
                    throw null;
                }
                em3.q.l("viewModel");
                throw null;
            }
        }

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public o(m00.b bVar, AvatarActivityV2 avatarActivityV2, m00.c cVar, ul3.d<? super o> dVar) {
            super(2, dVar);
            this.f34808c = bVar;
            this.f34809d = avatarActivityV2;
            this.f34810e = cVar;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new o(this.f34808c, this.f34809d, this.f34810e, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new o(this.f34808c, this.f34809d, this.f34810e, dVar).invokeSuspend(Unit.INSTANCE);
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            Object obj2;
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34807b;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                if (this.f34808c.f109468g != null) {
                    l0 l0Var = this.f34809d.f34736k;
                    if (l0Var != null) {
                        l0Var.b7(true);
                        g1 y84 = AvatarActivityV2.y8(this.f34809d);
                        AvatarActivityV2 avatarActivityV2 = this.f34809d;
                        String str = this.f34808c.f109468g;
                        this.f34807b = 1;
                        Objects.requireNonNull(y84);
                        obj2 = um3.g.g(w0.f166207d, new b1(avatarActivityV2, str, null), this);
                        if (obj2 == aVar) {
                            return aVar;
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                }
                return Unit.INSTANCE;
            } else if (i14 == 1) {
                ResultKt.throwOnFailure(obj);
                obj2 = obj;
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            if (((Boolean) obj2).booleanValue()) {
                l0 l0Var2 = this.f34809d.f34736k;
                if (l0Var2 != null) {
                    com.android.billingclient.api.z.m(l0Var2.f146856r, null);
                    AvatarActivityV2 avatarActivityV22 = this.f34809d;
                    m00.b bVar = this.f34808c;
                    avatarActivityV22.k9(new jr2.d(bVar.f109462a, jr2.e.gesture, new jr2.i(0, null, null, false, 0, 31), null, null, 0, 56), new a(avatarActivityV22, bVar, this.f34810e));
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                AvatarActivityV2 avatarActivityV23 = this.f34809d;
                int i15 = AvatarActivityV2.J;
                avatarActivityV23.v9(null);
                a.b bVar2 = new a.b(this.f34809d);
                bVar2.d(R.string.addFriends_error_failedToAddFriend);
                bVar2.f(17039370, new sz.t(this.f34809d, this.f34808c, 0));
                bVar2.f171187w = new sz.s(this.f34809d, this.f34808c);
                bVar2.k();
            }
            l0 l0Var3 = this.f34809d.f34736k;
            if (l0Var3 != null) {
                l0Var3.b7(false);
                return Unit.INSTANCE;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$onAvatarGestureSave$1", f = "AvatarActivityV2.kt", l = {2757}, m = "invokeSuspend")
    public static final class p extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public int f34814b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ m00.b f34815c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34816d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public p(m00.b bVar, AvatarActivityV2 avatarActivityV2, ul3.d<? super p> dVar) {
            super(2, dVar);
            this.f34815c = bVar;
            this.f34816d = avatarActivityV2;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new p(this.f34815c, this.f34816d, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new p(this.f34815c, this.f34816d, dVar).invokeSuspend(Unit.INSTANCE);
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            r0.a aVar;
            jr2.n nVar;
            er2.g gVar;
            vl3.a aVar2 = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34814b;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                if (this.f34815c.f109469h) {
                    aVar = r0.a.Video;
                } else {
                    aVar = r0.a.Image;
                }
                s0 s0Var = this.f34816d.f34737l;
                if (s0Var != null) {
                    gr2.o oVar = s0Var.f146959b;
                    boolean J = oVar.J("getCurrentAvatarTransform");
                    sz.g.a(b.d.a("getCurrentAvatarTransform:() scriptReady:"), !J, oVar);
                    if (!J && (gVar = oVar.f77697k) != null) {
                        YukiEffectService yukiEffectService = gVar.f69145a;
                        nVar = (jr2.n) new Gson().f(yukiEffectService != null ? yukiEffectService.getCurrentAvatarTransform() : "", jr2.n.class);
                    } else {
                        nVar = null;
                    }
                    em3.q.e(nVar, "avatarService.currentAvatarTransform");
                    this.f34816d.t9(false);
                    AvatarActivityV2 avatarActivityV2 = this.f34816d;
                    r0 r0Var = avatarActivityV2.f34739n;
                    m00.b bVar = this.f34815c;
                    int i15 = bVar.f109462a;
                    float f14 = bVar.f109464c;
                    jr2.s a14 = nVar.a();
                    String str = this.f34815c.f109468g;
                    this.f34814b = 1;
                    obj = r0Var.j(avatarActivityV2, i15, aVar, 1.0f, f14, a14, str, this);
                    if (obj == aVar2) {
                        return aVar2;
                    }
                } else {
                    em3.q.l("avatarManager");
                    throw null;
                }
            } else if (i14 == 1) {
                ResultKt.throwOnFailure(obj);
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            boolean booleanValue = ((Boolean) obj).booleanValue();
            l0 l0Var = this.f34816d.f34736k;
            if (l0Var != null) {
                r00.g gVar2 = r00.g.GESTURE;
                r00.c cVar = r00.c.DONE;
                r00.e eVar = r00.e.GESTURE;
                m00.c e64 = l0Var.e6(this.f34815c);
                r00.d dVar = new r00.d(eVar, e64 != null ? e64.f109475c : null, null, null, null, this.f34815c.f109463b, null);
                l0 l0Var2 = this.f34816d.f34736k;
                if (l0Var2 != null) {
                    l0Var.x6(gVar2, cVar, dVar, l0Var2.m6());
                    this.f34816d.R8();
                    if (booleanValue) {
                        AvatarActivityV2 avatarActivityV22 = this.f34816d;
                        l0 l0Var3 = avatarActivityV22.f34736k;
                        if (l0Var3 != null) {
                            l0Var3.L6(avatarActivityV22.f34739n.f146931a);
                            this.f34816d.Z8();
                            l0 l0Var4 = this.f34816d.f34736k;
                            if (l0Var4 != null) {
                                com.android.billingclient.api.z.m(l0Var4.f146850o, null);
                                l0Var4.u6(null);
                                com.android.billingclient.api.z.m(l0Var4.f146856r, null);
                            } else {
                                em3.q.l("viewModel");
                                throw null;
                            }
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    } else {
                        rz.i.d(rz.i.f140915a, this.f34816d, R.string.avatar_error_toast_cropviewerfail, 0, 0, 0, 0, false, 124);
                    }
                    return Unit.INSTANCE;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$onAvatarGestureSelectItem$1", f = "AvatarActivityV2.kt", l = {2806}, m = "invokeSuspend")
    public static final class q extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public int f34817b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ m00.b f34818c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34819d;

        public static final class a extends em3.s implements dm3.l<Boolean, Unit> {

            /* renamed from: b  reason: collision with root package name */
            public final /* synthetic */ AvatarActivityV2 f34820b;

            /* renamed from: c  reason: collision with root package name */
            public final /* synthetic */ m00.b f34821c;

            /* JADX INFO: super call moved to the top of the method (can break code semantics) */
            public a(AvatarActivityV2 avatarActivityV2, m00.b bVar) {
                super(1);
                this.f34820b = avatarActivityV2;
                this.f34821c = bVar;
            }

            /* Return type fixed from 'java.lang.Object' to match base method */
            /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
            @Override // dm3.l
            public Unit invoke(Boolean bool) {
                if (bool.booleanValue()) {
                    l0 l0Var = this.f34820b.f34736k;
                    if (l0Var != null) {
                        com.android.billingclient.api.z.m(l0Var.f146850o, this.f34821c);
                        s0 s0Var = this.f34820b.f34737l;
                        if (s0Var != null) {
                            s0Var.s(0.0f);
                            AvatarActivityV2.D8(this.f34820b, this.f34821c.f109462a);
                        } else {
                            em3.q.l("avatarManager");
                            throw null;
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    rz.i.d(rz.i.f140915a, this.f34820b, R.string.avatar_edit_toast_unabletodisplay, 0, 0, 0, 0, false, 124);
                }
                l0 l0Var2 = this.f34820b.f34736k;
                if (l0Var2 != null) {
                    r00.g gVar = r00.g.GESTURE;
                    r00.c cVar = r00.c.PLAY;
                    r00.e eVar = r00.e.GESTURE;
                    m00.c e64 = l0Var2.e6(this.f34821c);
                    r00.d dVar = new r00.d(eVar, e64 != null ? e64.f109475c : null, null, null, null, this.f34821c.f109463b, null);
                    l0 l0Var3 = this.f34820b.f34736k;
                    if (l0Var3 != null) {
                        l0Var2.x6(gVar, cVar, dVar, l0Var3.m6());
                        return Unit.INSTANCE;
                    }
                    em3.q.l("viewModel");
                    throw null;
                }
                em3.q.l("viewModel");
                throw null;
            }
        }

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public q(m00.b bVar, AvatarActivityV2 avatarActivityV2, ul3.d<? super q> dVar) {
            super(2, dVar);
            this.f34818c = bVar;
            this.f34819d = avatarActivityV2;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new q(this.f34818c, this.f34819d, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new q(this.f34818c, this.f34819d, dVar).invokeSuspend(Unit.INSTANCE);
        }

        /* JADX WARNING: Removed duplicated region for block: B:22:0x0066  */
        /* JADX WARNING: Removed duplicated region for block: B:25:0x0098  */
        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            l0 l0Var;
            Object obj2;
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34817b;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                m00.b bVar = this.f34818c;
                if (bVar.f109467f && bVar.f109468g != null) {
                    g1 y84 = AvatarActivityV2.y8(this.f34819d);
                    String str = this.f34818c.f109468g;
                    this.f34817b = 1;
                    Objects.requireNonNull(y84);
                    obj2 = um3.g.g(w0.f166207d, new d1(str, null), this);
                    if (obj2 == aVar) {
                        return aVar;
                    }
                }
                l0Var = this.f34819d.f34736k;
                if (l0Var == null) {
                    com.android.billingclient.api.z.m(l0Var.f146856r, null);
                    AvatarActivityV2 avatarActivityV2 = this.f34819d;
                    m00.b bVar2 = this.f34818c;
                    avatarActivityV2.k9(new jr2.d(bVar2.f109462a, jr2.e.gesture, new jr2.i(0, null, null, false, 0, 31), null, null, 0, 56), new a(avatarActivityV2, bVar2));
                    return Unit.INSTANCE;
                }
                em3.q.l("viewModel");
                throw null;
            } else if (i14 == 1) {
                ResultKt.throwOnFailure(obj);
                obj2 = obj;
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            if (!((Boolean) obj2).booleanValue()) {
                l0 l0Var2 = this.f34819d.f34736k;
                if (l0Var2 != null) {
                    com.android.billingclient.api.z.m(l0Var2.f146856r, this.f34818c);
                    return Unit.INSTANCE;
                }
                em3.q.l("viewModel");
                throw null;
            }
            l0Var = this.f34819d.f34736k;
            if (l0Var == null) {
            }
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$onCreate$1", f = "AvatarActivityV2.kt", l = {447}, m = "invokeSuspend")
    public static final class r extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public int f34822b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34823c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ AvatarIntentHelper$IntentParams f34824d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public r(AvatarActivityV2 avatarActivityV2, AvatarIntentHelper$IntentParams avatarIntentHelper$IntentParams, ul3.d<? super r> dVar) {
            super(2, dVar);
            this.f34823c = avatarActivityV2;
            this.f34824d = avatarIntentHelper$IntentParams;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new r(this.f34823c, this.f34824d, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new r(this.f34823c, this.f34824d, dVar).invokeSuspend(Unit.INSTANCE);
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34822b;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                AvatarActivityV2 avatarActivityV2 = this.f34823c;
                AvatarIntentHelper$IntentParams avatarIntentHelper$IntentParams = this.f34824d;
                this.f34822b = 1;
                if (AvatarActivityV2.B8(avatarActivityV2, avatarIntentHelper$IntentParams, this) == aVar) {
                    return aVar;
                }
            } else if (i14 == 1) {
                ResultKt.throwOnFailure(obj);
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            this.f34823c.f34746u = null;
            return Unit.INSTANCE;
        }
    }

    public static final class s extends em3.s implements dm3.l<Boolean, Unit> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34825b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public s(AvatarActivityV2 avatarActivityV2) {
            super(1);
            this.f34825b = avatarActivityV2;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // dm3.l
        public Unit invoke(Boolean bool) {
            boolean booleanValue = bool.booleanValue();
            AvatarActivityV2 avatarActivityV2 = this.f34825b;
            int i14 = AvatarActivityV2.J;
            avatarActivityV2.Z8();
            if (booleanValue) {
                bz.c K8 = this.f34825b.K8();
                AvatarActivityV2 avatarActivityV22 = this.f34825b;
                d.a aVar = dz.d.Companion;
                l0 l0Var = avatarActivityV22.f34736k;
                if (l0Var != null) {
                    c.b.a(K8, avatarActivityV22, null, null, aVar.a(l0Var.k6()), 6, null);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
            return Unit.INSTANCE;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$onFocusViewClickSetAsMain$1", f = "AvatarActivityV2.kt", l = {2574}, m = "invokeSuspend")
    public static final class t extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public int f34826b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34827c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ List<String> f34828d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ String f34829e;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public t(AvatarActivityV2 avatarActivityV2, List<String> list, String str, ul3.d<? super t> dVar) {
            super(2, dVar);
            this.f34827c = avatarActivityV2;
            this.f34828d = list;
            this.f34829e = str;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new t(this.f34827c, this.f34828d, this.f34829e, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new t(this.f34827c, this.f34828d, this.f34829e, dVar).invokeSuspend(Unit.INSTANCE);
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34826b;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                s0 s0Var = this.f34827c.f34737l;
                if (s0Var != null) {
                    List<String> list = this.f34828d;
                    String str = this.f34829e;
                    this.f34826b = 1;
                    if (s0Var.c(list, str, this) == aVar) {
                        return aVar;
                    }
                } else {
                    em3.q.l("avatarManager");
                    throw null;
                }
            } else if (i14 == 1) {
                ResultKt.throwOnFailure(obj);
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            AvatarActivityV2 avatarActivityV2 = this.f34827c;
            avatarActivityV2.f34732g = true;
            AvatarActivityV2.z8(avatarActivityV2, "[onFocusViewClickSetAsMain]");
            this.f34827c.t9(false);
            l0 l0Var = this.f34827c.f34736k;
            if (l0Var != null) {
                r00.g gVar = r00.g.FOCUS;
                r00.c cVar = r00.c.SET_MAIN_AVATAR;
                if (l0Var != null) {
                    Integer num = new Integer(l0Var.l6());
                    l0 l0Var2 = this.f34827c.f34736k;
                    if (l0Var2 != null) {
                        l0.w6(l0Var, gVar, cVar, null, num, l0Var2.m6(), 4);
                        return Unit.INSTANCE;
                    }
                    em3.q.l("viewModel");
                    throw null;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$onFocusViewSelectAvatar$1", f = "AvatarActivityV2.kt", l = {2491, 2499}, m = "invokeSuspend")
    public static final class u extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public Object f34830b;

        /* renamed from: c  reason: collision with root package name */
        public int f34831c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34832d;

        /* renamed from: e  reason: collision with root package name */
        public final /* synthetic */ int f34833e;

        /* renamed from: f  reason: collision with root package name */
        public final /* synthetic */ boolean f34834f;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public u(AvatarActivityV2 avatarActivityV2, int i14, boolean z14, ul3.d<? super u> dVar) {
            super(2, dVar);
            this.f34832d = avatarActivityV2;
            this.f34833e = i14;
            this.f34834f = z14;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new u(this.f34832d, this.f34833e, this.f34834f, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new u(this.f34832d, this.f34833e, this.f34834f, dVar).invokeSuspend(Unit.INSTANCE);
        }

        /* JADX WARNING: Removed duplicated region for block: B:34:0x00ad  */
        /* JADX WARNING: Removed duplicated region for block: B:35:0x00b2  */
        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            String str;
            s0 s0Var;
            String str2;
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34831c;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                s0 s0Var2 = this.f34832d.f34737l;
                if (s0Var2 != null) {
                    this.f34831c = 1;
                    if (s0Var2.G(this) == aVar) {
                        return aVar;
                    }
                } else {
                    em3.q.l("avatarManager");
                    throw null;
                }
            } else if (i14 == 1) {
                ResultKt.throwOnFailure(obj);
            } else if (i14 == 2) {
                str2 = (String) this.f34830b;
                ResultKt.throwOnFailure(obj);
                str = str2;
                AvatarActivityV2 avatarActivityV2 = this.f34832d;
                int i15 = AvatarActivityV2.J;
                boolean i94 = avatarActivityV2.i9(str);
                if (i94 && !em3.q.b(str, "-1")) {
                    s0Var = this.f34832d.f34737l;
                    if (s0Var == null) {
                        s0Var.y(false);
                    } else {
                        em3.q.l("avatarManager");
                        throw null;
                    }
                }
                if (i94 && this.f34834f) {
                    l0 l0Var = this.f34832d.f34736k;
                    if (l0Var != null) {
                        l0.w6(l0Var, r00.g.FOCUS, r00.c.SWIPE, null, new Integer(this.f34833e), null, 20);
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                }
                return Unit.INSTANCE;
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            l0 l0Var2 = this.f34832d.f34736k;
            if (l0Var2 != null) {
                int i16 = this.f34833e;
                List<m00.d> value = l0Var2.f146836h.getValue();
                if (value == null || i16 > ql3.p.e(value)) {
                    str = "-1";
                } else {
                    str = value.get(i16).f109479a;
                }
                AvatarActivityV2 avatarActivityV22 = this.f34832d;
                StringBuilder a14 = b.d.a("[onFocusViewSelectAvatar] position: ");
                a14.append(this.f34833e);
                a14.append(", byScroll: ");
                a14.append(this.f34834f);
                a14.append(" avatarId: ");
                a14.append(str);
                AvatarActivityV2.z8(avatarActivityV22, a14.toString());
                s1 s1Var = this.f34832d.f34745t;
                if (s1Var != null) {
                    this.f34830b = str;
                    this.f34831c = 2;
                    if (s1Var.m(this) == aVar) {
                        return aVar;
                    }
                    str2 = str;
                    str = str2;
                }
                AvatarActivityV2 avatarActivityV23 = this.f34832d;
                int i152 = AvatarActivityV2.J;
                boolean i942 = avatarActivityV23.i9(str);
                s0Var = this.f34832d.f34737l;
                if (s0Var == null) {
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        }
    }

    public static final class v extends em3.s implements dm3.a<Unit> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34835b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ z0 f34836c;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public v(AvatarActivityV2 avatarActivityV2, z0 z0Var) {
            super(0);
            this.f34835b = avatarActivityV2;
            this.f34836c = z0Var;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public Unit invoke() {
            boolean z14;
            AvatarActivityV2 avatarActivityV2 = this.f34835b;
            int i14 = AvatarActivityV2.J;
            avatarActivityV2.s9();
            z0 z0Var = this.f34836c;
            if (z0Var instanceof z0.a.e) {
                AvatarActivityV2 avatarActivityV22 = this.f34835b;
                l0 l0Var = avatarActivityV22.f34736k;
                if (l0Var != null) {
                    if (l0Var.f146828d) {
                        z14 = false;
                    } else {
                        l0Var.f146828d = true;
                        z14 = l0Var.U5().f34546l;
                    }
                    if (avatarActivityV22.f34736k != null) {
                        Context applicationContext = avatarActivityV22.getApplicationContext();
                        em3.q.e(applicationContext, "context.applicationContext");
                        int i15 = applicationContext.getSharedPreferences(xi3.a.AVATAR.key, 0).getInt("avatar.count", -1);
                        em3.q.f("openFullPickerIfNeed() needOpenFullPicker:" + z14 + " avatarCount:" + i15, "msg");
                        if (z14 && i15 > 0) {
                            dz.a aVar = dz.a.f65738a;
                            d.a aVar2 = dz.d.Companion;
                            l0 l0Var2 = avatarActivityV22.f34736k;
                            if (l0Var2 != null) {
                                dz.d a14 = aVar2.a(l0Var2.k6());
                                ql3.w wVar = ql3.w.f133304b;
                                dz.a.v(aVar, avatarActivityV22, a14, wVar, wVar, null, false, false, false, avatarActivityV22.getString(R.string.avatar_friendlist_title_friends), dz.b.NONE, 16);
                            } else {
                                em3.q.l("viewModel");
                                throw null;
                            }
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else if (z0Var instanceof z0.a.f) {
                AvatarActivityV2 avatarActivityV23 = this.f34835b;
                SharedPreferences sharedPreferences = avatarActivityV23.getSharedPreferences("suggestion_pref", 0);
                em3.q.e(sharedPreferences, "context.getSharedPrefere…ME, Context.MODE_PRIVATE)");
                if (sharedPreferences.getInt("agreement.image_collect.showed", 0) == 0) {
                    Intent intent = new Intent();
                    intent.setClass(avatarActivityV23, SuggestionAgreementActivity.class);
                    l0 l0Var3 = avatarActivityV23.f34736k;
                    if (l0Var3 != null) {
                        intent.putExtra("media.location", l0Var3.k6());
                        rz.l.a(intent, avatarActivityV23);
                        avatarActivityV23.startActivity(intent);
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                }
            }
            return Unit.INSTANCE;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$onMainClickArCamera$1", f = "AvatarActivityV2.kt", l = {}, m = "invokeSuspend")
    public static final class w extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34837b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public w(AvatarActivityV2 avatarActivityV2, ul3.d<? super w> dVar) {
            super(2, dVar);
            this.f34837b = avatarActivityV2;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new w(this.f34837b, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new w(this.f34837b, dVar).invokeSuspend(Unit.INSTANCE);
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            ResultKt.throwOnFailure(obj);
            AvatarActivityV2 avatarActivityV2 = this.f34837b;
            int i14 = AvatarActivityV2.J;
            bz.c K8 = avatarActivityV2.K8();
            AvatarActivityV2 avatarActivityV22 = this.f34837b;
            l0 l0Var = avatarActivityV22.f34736k;
            if (l0Var != null) {
                String str = l0Var.f146838i;
                uy.z d14 = avatarActivityV22.f34739n.d();
                Integer num = d14 != null ? new Integer(d14.a()) : null;
                l0 l0Var2 = this.f34837b.f34736k;
                if (l0Var2 != null) {
                    K8.J(avatarActivityV22, 20002, str, num, null, l0Var2.k6());
                    l0 l0Var3 = this.f34837b.f34736k;
                    if (l0Var3 != null) {
                        r00.g gVar = r00.g.MAIN;
                        r00.c cVar = r00.c.CAMERA_AR;
                        if (l0Var3 != null) {
                            l0.w6(l0Var3, gVar, cVar, null, null, l0Var3.m6(), 12);
                            return Unit.INSTANCE;
                        }
                        em3.q.l("viewModel");
                        throw null;
                    }
                    em3.q.l("viewModel");
                    throw null;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    @wl3.e(c = "com.linecorp.line.avatar.v2.AvatarActivityV2$onNewIntent$1", f = "AvatarActivityV2.kt", l = {246}, m = "invokeSuspend")
    public static final class x extends wl3.i implements dm3.p<um3.h0, ul3.d<? super Unit>, Object> {

        /* renamed from: b  reason: collision with root package name */
        public int f34838b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34839c;

        /* renamed from: d  reason: collision with root package name */
        public final /* synthetic */ AvatarIntentHelper$IntentParams f34840d;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public x(AvatarActivityV2 avatarActivityV2, AvatarIntentHelper$IntentParams avatarIntentHelper$IntentParams, ul3.d<? super x> dVar) {
            super(2, dVar);
            this.f34839c = avatarActivityV2;
            this.f34840d = avatarIntentHelper$IntentParams;
        }

        @Override // wl3.a
        public final ul3.d<Unit> create(Object obj, ul3.d<?> dVar) {
            return new x(this.f34839c, this.f34840d, dVar);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, java.lang.Object] */
        @Override // dm3.p
        public Object invoke(um3.h0 h0Var, ul3.d<? super Unit> dVar) {
            return new x(this.f34839c, this.f34840d, dVar).invokeSuspend(Unit.INSTANCE);
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            vl3.a aVar = vl3.a.COROUTINE_SUSPENDED;
            int i14 = this.f34838b;
            if (i14 == 0) {
                ResultKt.throwOnFailure(obj);
                AvatarActivityV2 avatarActivityV2 = this.f34839c;
                AvatarIntentHelper$IntentParams avatarIntentHelper$IntentParams = this.f34840d;
                this.f34838b = 1;
                if (AvatarActivityV2.B8(avatarActivityV2, avatarIntentHelper$IntentParams, this) == aVar) {
                    return aVar;
                }
            } else if (i14 == 1) {
                ResultKt.throwOnFailure(obj);
            } else {
                throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
            }
            this.f34839c.f34746u = null;
            return Unit.INSTANCE;
        }
    }

    public static final class y extends em3.s implements dm3.a<Unit> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34841b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public y(AvatarActivityV2 avatarActivityV2) {
            super(0);
            this.f34841b = avatarActivityV2;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public Unit invoke() {
            AvatarActivityV2 avatarActivityV2 = this.f34841b;
            l0 l0Var = avatarActivityV2.f34736k;
            if (l0Var != null) {
                if (l0Var.f146843k0) {
                    rz.i.d(rz.i.f140915a, avatarActivityV2, R.string.avatar_common_toast_avataradded, 0, 0, 0, 0, false, 124);
                    l0 l0Var2 = this.f34841b.f34736k;
                    if (l0Var2 != null) {
                        l0Var2.f146843k0 = false;
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                }
                this.f34841b.s9();
                return Unit.INSTANCE;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    public static final class z extends em3.s implements dm3.a<Unit> {

        /* renamed from: b  reason: collision with root package name */
        public final /* synthetic */ AvatarActivityV2 f34842b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public z(AvatarActivityV2 avatarActivityV2) {
            super(0);
            this.f34842b = avatarActivityV2;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        @Override // dm3.a
        public Unit invoke() {
            s0 s0Var = this.f34842b.f34737l;
            if (s0Var != null) {
                s0Var.f146959b.L(System.currentTimeMillis());
                AvatarActivityV2 avatarActivityV2 = this.f34842b;
                l0 l0Var = avatarActivityV2.f34736k;
                if (l0Var != null) {
                    if (l0Var.f146843k0) {
                        rz.i.d(rz.i.f140915a, avatarActivityV2, R.string.avatar_common_toast_avataradded, 0, 0, 0, 0, false, 124);
                        l0 l0Var2 = this.f34842b.f34736k;
                        if (l0Var2 != null) {
                            l0Var2.f146843k0 = false;
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    }
                    this.f34842b.s9();
                    return Unit.INSTANCE;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("avatarManager");
            throw null;
        }
    }

    public AvatarActivityV2() {
        androidx.activity.result.c<Intent> registerForActivityResult = registerForActivityResult(new z0.d(), new sz.c(this, 0));
        em3.q.e(registerForActivityResult, "registerForActivityResul…(it.resultCode)\n        }");
        this.C = registerForActivityResult;
        androidx.activity.result.c<Intent> registerForActivityResult2 = registerForActivityResult(new z0.d(), new u8.q(this, 3));
        em3.q.e(registerForActivityResult2, "registerForActivityResul…tCode, it.data)\n        }");
        this.D = registerForActivityResult2;
        androidx.activity.result.c<Intent> registerForActivityResult3 = registerForActivityResult(new z0.d(), new wu.f(this));
        em3.q.e(registerForActivityResult3, "registerForActivityResul…showIntroPage()\n        }");
        this.E = registerForActivityResult3;
        this.F = LazyKt.lazy(new c0(this));
    }

    public static final void A8(AvatarActivityV2 avatarActivityV2, boolean z14) {
        l0 l0Var = avatarActivityV2.f34736k;
        if (l0Var != null) {
            um3.g.d(j2.e.g(l0Var), null, 0, new sz.y(avatarActivityV2, z14, null), 3, null);
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    /* JADX DEBUG: Multi-variable search result rejected for r10v4, resolved type: boolean */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r2v35, types: [java.lang.Throwable, ul3.d, kotlin.Unit, java.lang.Object] */
    /* JADX WARN: Type inference failed for: r2v47 */
    /* JADX WARN: Type inference failed for: r2v49 */
    /* JADX WARNING: Code restructure failed: missing block: B:137:0x038c, code lost:
        if (r2.m(r3) == r8) goto L_0x05bb;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:142:0x03a2, code lost:
        if (r1.D(r0, r3) == r8) goto L_0x05bb;
     */
    /* JADX WARNING: Removed duplicated region for block: B:10:0x003b  */
    /* JADX WARNING: Removed duplicated region for block: B:11:0x0052  */
    /* JADX WARNING: Removed duplicated region for block: B:121:0x033a  */
    /* JADX WARNING: Removed duplicated region for block: B:122:0x0344  */
    /* JADX WARNING: Removed duplicated region for block: B:12:0x0068  */
    /* JADX WARNING: Removed duplicated region for block: B:134:0x037d  */
    /* JADX WARNING: Removed duplicated region for block: B:13:0x007d  */
    /* JADX WARNING: Removed duplicated region for block: B:141:0x0397  */
    /* JADX WARNING: Removed duplicated region for block: B:143:0x03a6  */
    /* JADX WARNING: Removed duplicated region for block: B:145:0x03aa  */
    /* JADX WARNING: Removed duplicated region for block: B:159:0x03ee  */
    /* JADX WARNING: Removed duplicated region for block: B:15:0x009c  */
    /* JADX WARNING: Removed duplicated region for block: B:163:0x0408  */
    /* JADX WARNING: Removed duplicated region for block: B:166:0x040f  */
    /* JADX WARNING: Removed duplicated region for block: B:16:0x00b1  */
    /* JADX WARNING: Removed duplicated region for block: B:170:0x0419  */
    /* JADX WARNING: Removed duplicated region for block: B:17:0x00c8  */
    /* JADX WARNING: Removed duplicated region for block: B:189:0x0462  */
    /* JADX WARNING: Removed duplicated region for block: B:18:0x00cd  */
    /* JADX WARNING: Removed duplicated region for block: B:19:0x00dd  */
    /* JADX WARNING: Removed duplicated region for block: B:207:0x04ca  */
    /* JADX WARNING: Removed duplicated region for block: B:20:0x00ea  */
    /* JADX WARNING: Removed duplicated region for block: B:216:0x04e8  */
    /* JADX WARNING: Removed duplicated region for block: B:21:0x0110  */
    /* JADX WARNING: Removed duplicated region for block: B:226:0x052d  */
    /* JADX WARNING: Removed duplicated region for block: B:236:0x058b  */
    /* JADX WARNING: Removed duplicated region for block: B:250:0x05c5  */
    /* JADX WARNING: Removed duplicated region for block: B:261:0x05ec  */
    /* JADX WARNING: Removed duplicated region for block: B:270:0x0604  */
    /* JADX WARNING: Removed duplicated region for block: B:303:0x065c  */
    /* JADX WARNING: Removed duplicated region for block: B:65:0x0217  */
    /* JADX WARNING: Removed duplicated region for block: B:8:0x0033  */
    /* JADX WARNING: Unknown variable types count: 1 */
    public static final Object B8(AvatarActivityV2 avatarActivityV2, AvatarIntentHelper$IntentParams avatarIntentHelper$IntentParams, ul3.d dVar) {
        sz.z zVar;
        z0.a aVar;
        AvatarActivityV2 avatarActivityV22;
        z0.a aVar2;
        String str;
        String str2;
        uy.x xVar;
        int i14;
        l0 l0Var;
        AvatarActivityV2 avatarActivityV23;
        vl3.a aVar3;
        String str3;
        int a14;
        int i15;
        String str4;
        s0 s0Var;
        AvatarActivityV2 avatarActivityV24;
        String str5;
        z0.a aVar4;
        String str6;
        int i16;
        s0 s0Var2;
        AvatarActivityV2 avatarActivityV25;
        z0.a aVar5;
        int i17;
        AvatarActivityV2 avatarActivityV26;
        s1 s1Var;
        AvatarActivityV2 avatarActivityV27;
        String str7;
        s0 s0Var3;
        String str8;
        String str9;
        Uri uri;
        boolean z14;
        String str10;
        ?? r24;
        int i18;
        z0.a aVar6;
        AvatarActivityV2 avatarActivityV28;
        l0 l0Var2;
        String str11;
        String str12;
        z0.a aVar7;
        Object obj;
        boolean z15;
        s0 s0Var4;
        String str13;
        Object obj2;
        int i19;
        boolean z16;
        s0 s0Var5;
        AvatarActivityV2 avatarActivityV29 = avatarActivityV2;
        Objects.requireNonNull(avatarActivityV2);
        if (dVar instanceof sz.z) {
            zVar = (sz.z) dVar;
            int i24 = zVar.f147086k;
            if ((i24 & Integer.MIN_VALUE) != 0) {
                zVar.f147086k = i24 - Integer.MIN_VALUE;
                Object obj3 = zVar.f147084i;
                vl3.a aVar8 = vl3.a.COROUTINE_SUSPENDED;
                int i25 = 2;
                boolean z17 = true;
                switch (zVar.f147086k) {
                    case 0:
                        ResultKt.throwOnFailure(obj3);
                        Object obj4 = avatarIntentHelper$IntentParams.f34540f;
                        str10 = avatarIntentHelper$IntentParams.f34539e;
                        String str14 = avatarIntentHelper$IntentParams.f34538d;
                        boolean z18 = avatarIntentHelper$IntentParams.f34546l;
                        int i26 = b.$EnumSwitchMapping$0[j.q.e(avatarIntentHelper$IntentParams.f34536b)];
                        if (i26 != 1) {
                            if (i26 == 2) {
                                String str15 = avatarIntentHelper$IntentParams.f34541g;
                                Integer l14 = str15 != null ? sm3.q.l(str15) : null;
                                String str16 = avatarIntentHelper$IntentParams.f34542h;
                                obj = new z0.a.b(null, false, l14, str16 != null ? sm3.q.l(str16) : null, avatarIntentHelper$IntentParams.f34539e, avatarIntentHelper$IntentParams.f34544j);
                            } else if (i26 == 3) {
                                obj = new z0.a.f(null, 1);
                            } else {
                                throw new NoWhenBranchMatchedException();
                            }
                        } else if (avatarIntentHelper$IntentParams.f34551q) {
                            String str17 = avatarIntentHelper$IntentParams.f34552r;
                            obj = new z0.a.d(false, str17 != null ? sm3.q.l(str17) : null);
                        } else if (avatarIntentHelper$IntentParams.f34547m) {
                            obj = new z0.a.c(avatarIntentHelper$IntentParams.f34549o, false, 2);
                        } else {
                            obj = new z0.a.e(null, 1);
                        }
                        boolean z19 = obj instanceof z0.a.b;
                        boolean z24 = obj instanceof z0.a.f;
                        boolean z25 = obj instanceof z0.a.c;
                        boolean z26 = avatarIntentHelper$IntentParams.f34551q;
                        str = "viewModel";
                        boolean z27 = avatarIntentHelper$IntentParams.f34548n;
                        str2 = "avatarManager";
                        StringBuilder sb4 = new StringBuilder();
                        sb4.append("processAvatarParam() suggestionImageUri:");
                        sb4.append(obj4);
                        sb4.append(" avatarMetaData:");
                        sb4.append(str10 != null ? Boolean.valueOf(!sm3.r.u(str10)) : null);
                        sb4.append(" avatarId:");
                        sb4.append(str14);
                        sb4.append(" friendsList:");
                        sb4.append(z18);
                        sb4.append(" avatarVisibleMode:");
                        sb4.append(obj);
                        sb4.append(" isGestureDrawer:");
                        sb4.append(z26);
                        sb4.append(" (focusMode: ");
                        sb4.append(z25);
                        sb4.append(", stickerId: ");
                        sb4.append(avatarIntentHelper$IntentParams.f34552r);
                        sb4.append(')');
                        em3.q.f(sb4.toString(), "msg");
                        if (obj4 == null && str10 == null) {
                            if (!(str14 != null && (sm3.r.u(str14) ^ true))) {
                                z15 = false;
                                s0Var4 = avatarActivityV29.f34737l;
                                if (s0Var4 == null) {
                                    if (!s0Var4.p() || z15) {
                                        boolean z28 = obj instanceof z0.a.e;
                                        boolean z29 = z15 && !z24 && z19 == 0;
                                        em3.q.f("showFullLoading() loadWithData:" + z15 + " waitAvatarShown:" + z28 + " waitAvatarCreated:" + z29, "msg");
                                        s0 s0Var6 = avatarActivityV29.f34737l;
                                        if (s0Var6 != null) {
                                            boolean z34 = s0Var6.f146963f;
                                            boolean p14 = s0Var6.p();
                                            str8 = "msg";
                                            s0 s0Var7 = avatarActivityV29.f34737l;
                                            if (s0Var7 != null) {
                                                int size = s0Var7.l().size();
                                                z16 = z27;
                                                s0 s0Var8 = avatarActivityV29.f34737l;
                                                if (s0Var8 != null) {
                                                    boolean z35 = !sm3.r.u(s0Var8.f146966i);
                                                    i19 = z19 ? 1 : 0;
                                                    s0 s0Var9 = avatarActivityV29.f34737l;
                                                    if (s0Var9 != null) {
                                                        int i27 = s0Var9.f146965h;
                                                        obj2 = obj;
                                                        l0 l0Var3 = avatarActivityV29.f34736k;
                                                        if (l0Var3 != null) {
                                                            str13 = str14;
                                                            l0Var3.M6(false);
                                                            l0 l0Var4 = avatarActivityV29.f34736k;
                                                            if (l0Var4 != null) {
                                                                l0Var4.O6(false);
                                                                l0 l0Var5 = avatarActivityV29.f34736k;
                                                                if (l0Var5 != null) {
                                                                    l0Var5.T6(Boolean.FALSE);
                                                                    l0 l0Var6 = avatarActivityV29.f34736k;
                                                                    if (l0Var6 != null) {
                                                                        l0Var6.N6(z34);
                                                                        l0 l0Var7 = avatarActivityV29.f34736k;
                                                                        if (l0Var7 != null) {
                                                                            l0Var7.P6(p14);
                                                                            l0 l0Var8 = avatarActivityV29.f34736k;
                                                                            if (l0Var8 != null) {
                                                                                l0Var8.e7(size);
                                                                                l0 l0Var9 = avatarActivityV29.f34736k;
                                                                                if (l0Var9 != null) {
                                                                                    l0Var9.R6(z35);
                                                                                    l0 l0Var10 = avatarActivityV29.f34736k;
                                                                                    if (l0Var10 != null) {
                                                                                        l0Var10.B6(i27);
                                                                                        l0 l0Var11 = avatarActivityV29.f34736k;
                                                                                        if (l0Var11 != null) {
                                                                                            l0Var11.K6(new AvatarLoadFragmentV2.a(z15, z28, z29));
                                                                                        } else {
                                                                                            em3.q.l(str);
                                                                                            throw null;
                                                                                        }
                                                                                    } else {
                                                                                        em3.q.l(str);
                                                                                        throw null;
                                                                                    }
                                                                                } else {
                                                                                    em3.q.l(str);
                                                                                    throw null;
                                                                                }
                                                                            } else {
                                                                                em3.q.l(str);
                                                                                throw null;
                                                                            }
                                                                        } else {
                                                                            em3.q.l(str);
                                                                            throw null;
                                                                        }
                                                                    } else {
                                                                        em3.q.l(str);
                                                                        throw null;
                                                                    }
                                                                } else {
                                                                    em3.q.l(str);
                                                                    throw null;
                                                                }
                                                            } else {
                                                                em3.q.l(str);
                                                                throw null;
                                                            }
                                                        } else {
                                                            em3.q.l(str);
                                                            throw null;
                                                        }
                                                    } else {
                                                        em3.q.l(str2);
                                                        throw null;
                                                    }
                                                } else {
                                                    em3.q.l(str2);
                                                    throw null;
                                                }
                                            } else {
                                                em3.q.l(str2);
                                                throw null;
                                            }
                                        } else {
                                            em3.q.l(str2);
                                            throw null;
                                        }
                                    } else {
                                        str8 = "msg";
                                        z16 = z27;
                                        obj2 = obj;
                                        i19 = z19;
                                        str13 = str14;
                                    }
                                    if (z26) {
                                        l0 l0Var12 = avatarActivityV29.f34736k;
                                        if (l0Var12 != null) {
                                            l0Var12.X6(new z0.a.c(avatarIntentHelper$IntentParams.f34549o, false, 2));
                                            s0 s0Var10 = avatarActivityV29.f34737l;
                                            if (s0Var10 != null) {
                                                zVar.f147077b = avatarActivityV29;
                                                zVar.f147078c = obj4;
                                                zVar.f147079d = str10;
                                                zVar.f147080e = str13;
                                                zVar.f147081f = obj2;
                                                zVar.f147082g = i19;
                                                z14 = z16;
                                                zVar.f147083h = z14;
                                                zVar.f147086k = 1;
                                                aVar3 = aVar8;
                                                if (s0Var10.G(zVar) != aVar3) {
                                                    uri = obj4;
                                                    str11 = str10;
                                                    i18 = i19;
                                                    aVar7 = obj2;
                                                    str12 = str13;
                                                    r24 = 0;
                                                    str9 = str12;
                                                    aVar = aVar7;
                                                    str10 = str11;
                                                    if (z14 && !(aVar instanceof z0.a.e)) {
                                                        l0Var2 = avatarActivityV29.f34736k;
                                                        if (l0Var2 != null) {
                                                            l0Var2.X6(new z0.a.e(r24, 1));
                                                        } else {
                                                            em3.q.l(str);
                                                            throw r24;
                                                        }
                                                    }
                                                    if (uri != null) {
                                                        Y8(avatarActivityV29, aVar, false, 2);
                                                        c00.g gVar = avatarActivityV29.f34738m;
                                                        if (gVar != null) {
                                                            l0 l0Var13 = avatarActivityV29.f34736k;
                                                            if (l0Var13 != null) {
                                                                boolean q64 = l0Var13.q6();
                                                                zVar.f147077b = avatarActivityV29;
                                                                zVar.f147078c = r24;
                                                                zVar.f147079d = r24;
                                                                zVar.f147080e = r24;
                                                                zVar.f147081f = r24;
                                                                zVar.f147086k = 2;
                                                                obj3 = um3.g.g(w0.f166207d, new c00.f(gVar, uri, q64, r24), zVar);
                                                                if (obj3 != aVar3) {
                                                                    avatarActivityV27 = avatarActivityV29;
                                                                    o1 o1Var = (o1) obj3;
                                                                    str7 = o1Var.f146921b;
                                                                    if (str7 == null) {
                                                                        s1 s1Var2 = avatarActivityV27.f34745t;
                                                                        if (s1Var2 != null) {
                                                                            zVar.f147077b = avatarActivityV27;
                                                                            zVar.f147078c = str7;
                                                                            zVar.f147086k = 3;
                                                                            break;
                                                                        }
                                                                        s0Var3 = avatarActivityV27.f34737l;
                                                                        if (s0Var3 == null) {
                                                                            zVar.f147077b = null;
                                                                            zVar.f147078c = null;
                                                                            zVar.f147086k = 4;
                                                                            break;
                                                                        } else {
                                                                            em3.q.l(str2);
                                                                            throw null;
                                                                        }
                                                                    } else {
                                                                        avatarActivityV27.a9(new u.d(0, null, o1Var.f146922c));
                                                                        return Unit.INSTANCE;
                                                                    }
                                                                }
                                                            } else {
                                                                em3.q.l(str);
                                                                throw r24;
                                                            }
                                                        } else {
                                                            em3.q.l("suggestionService");
                                                            throw r24;
                                                        }
                                                    } else if (str10 != null) {
                                                        s0 s0Var11 = avatarActivityV29.f34737l;
                                                        if (s0Var11 != null) {
                                                            zVar.f147077b = avatarActivityV29;
                                                            zVar.f147078c = str10;
                                                            zVar.f147079d = aVar;
                                                            zVar.f147080e = r24;
                                                            zVar.f147081f = r24;
                                                            zVar.f147082g = i18;
                                                            zVar.f147086k = 5;
                                                            if (s0Var11.G(zVar) != aVar3) {
                                                                i25 = 2;
                                                                avatarActivityV26 = avatarActivityV29;
                                                                i17 = i18;
                                                                str6 = str10;
                                                                aVar5 = aVar;
                                                                Y8(avatarActivityV26, aVar5, false, i25);
                                                                s1Var = avatarActivityV26.f34745t;
                                                                if (s1Var == null) {
                                                                    zVar.f147077b = avatarActivityV26;
                                                                    zVar.f147078c = str6;
                                                                    zVar.f147079d = aVar5;
                                                                    zVar.f147082g = i17;
                                                                    zVar.f147086k = 6;
                                                                    if (s1Var.m(zVar) != aVar3) {
                                                                        avatarActivityV25 = avatarActivityV26;
                                                                        Unit unit = Unit.INSTANCE;
                                                                        aVar = aVar5;
                                                                        i16 = i17;
                                                                        avatarActivityV29 = avatarActivityV25;
                                                                        s0Var2 = avatarActivityV29.f34737l;
                                                                        if (s0Var2 != null) {
                                                                            s0Var2.E(str6, i16 != 0);
                                                                            Y8(avatarActivityV29, aVar, false, 2);
                                                                            return Unit.INSTANCE;
                                                                        }
                                                                        em3.q.l(str2);
                                                                        throw null;
                                                                    }
                                                                } else {
                                                                    aVar = aVar5;
                                                                    i16 = i17;
                                                                    avatarActivityV29 = avatarActivityV26;
                                                                    s0Var2 = avatarActivityV29.f34737l;
                                                                    if (s0Var2 != null) {
                                                                    }
                                                                }
                                                            }
                                                        } else {
                                                            em3.q.l(str2);
                                                            throw r24;
                                                        }
                                                    } else {
                                                        if (str9 != null && (sm3.r.u(str9) ^ true)) {
                                                            l0 l0Var14 = avatarActivityV29.f34736k;
                                                            if (l0Var14 != null) {
                                                                em3.q.f(str9, TtmlNode.ATTR_ID);
                                                                l0Var14.f146838i = str9;
                                                                s0 s0Var12 = avatarActivityV29.f34737l;
                                                                if (s0Var12 != null) {
                                                                    zVar.f147077b = avatarActivityV29;
                                                                    zVar.f147078c = str9;
                                                                    zVar.f147079d = aVar;
                                                                    zVar.f147080e = null;
                                                                    zVar.f147081f = null;
                                                                    zVar.f147082g = i18;
                                                                    zVar.f147086k = 7;
                                                                    if (s0Var12.G(zVar) != aVar3) {
                                                                        str4 = str9;
                                                                        aVar6 = aVar;
                                                                        avatarActivityV28 = avatarActivityV29;
                                                                        aVar4 = aVar6;
                                                                        s0Var5 = avatarActivityV28.f34737l;
                                                                        if (s0Var5 == null) {
                                                                            int h14 = s0Var5.h();
                                                                            s0 s0Var13 = avatarActivityV28.f34737l;
                                                                            if (s0Var13 != null) {
                                                                                boolean z36 = ql3.l.z(s0Var13.j(), str4);
                                                                                str3 = str8;
                                                                                em3.q.f("processAvatarParam(avatarId) avatarCount:" + h14 + " isMyAvatar:" + z36, str3);
                                                                                s0 s0Var14 = avatarActivityV28.f34737l;
                                                                                if (s0Var14 == null) {
                                                                                    em3.q.l(str2);
                                                                                    throw null;
                                                                                } else if (!s0Var14.p() || h14 <= -1) {
                                                                                    aVar = aVar4;
                                                                                    avatarActivityV29 = avatarActivityV28;
                                                                                } else if (z36) {
                                                                                    avatarActivityV28.X8(aVar4, false);
                                                                                    s1 s1Var3 = avatarActivityV28.f34745t;
                                                                                    if (s1Var3 != null) {
                                                                                        zVar.f147077b = avatarActivityV28;
                                                                                        zVar.f147078c = str4;
                                                                                        zVar.f147079d = aVar4;
                                                                                        zVar.f147086k = 8;
                                                                                        if (s1Var3.m(zVar) != aVar3) {
                                                                                            str5 = str4;
                                                                                            avatarActivityV24 = avatarActivityV28;
                                                                                            Unit unit2 = Unit.INSTANCE;
                                                                                            aVar = aVar4;
                                                                                            str4 = str5;
                                                                                            avatarActivityV29 = avatarActivityV24;
                                                                                            s0Var = avatarActivityV29.f34737l;
                                                                                            if (s0Var != null) {
                                                                                                s0Var.t(str4);
                                                                                                l0 l0Var15 = avatarActivityV29.f34736k;
                                                                                                if (l0Var15 != null) {
                                                                                                    l0Var15.O6(true);
                                                                                                    l0 l0Var16 = avatarActivityV29.f34736k;
                                                                                                    if (l0Var16 != null) {
                                                                                                        l0Var16.M6(true);
                                                                                                    } else {
                                                                                                        em3.q.l(str);
                                                                                                        throw null;
                                                                                                    }
                                                                                                } else {
                                                                                                    em3.q.l(str);
                                                                                                    throw null;
                                                                                                }
                                                                                            } else {
                                                                                                em3.q.l(str2);
                                                                                                throw null;
                                                                                            }
                                                                                        }
                                                                                    } else {
                                                                                        aVar = aVar4;
                                                                                        avatarActivityV29 = avatarActivityV28;
                                                                                        s0Var = avatarActivityV29.f34737l;
                                                                                        if (s0Var != null) {
                                                                                        }
                                                                                    }
                                                                                } else {
                                                                                    if (rz.i.f140915a.a(avatarActivityV28, h14)) {
                                                                                        avatarActivityV28.J8();
                                                                                    }
                                                                                    uy.l lVar = new uy.l(avatarActivityV28.K8());
                                                                                    zVar.f147077b = avatarActivityV28;
                                                                                    zVar.f147078c = aVar4;
                                                                                    zVar.f147079d = null;
                                                                                    zVar.f147082g = i18;
                                                                                    zVar.f147086k = 9;
                                                                                    obj3 = lVar.e(0, str4, zVar);
                                                                                    if (obj3 != aVar3) {
                                                                                        z17 = true;
                                                                                        avatarActivityV22 = avatarActivityV28;
                                                                                        aVar2 = aVar4;
                                                                                        i14 = i18;
                                                                                        c.f fVar = (c.f) obj3;
                                                                                        a14 = fVar.f168605a.a();
                                                                                        if (a14 == i1.RES_CODE_SUCCESS.d()) {
                                                                                            StringBuilder a15 = b.d.a("ERROR: ");
                                                                                            a15.append(fVar.f168605a.f168675b);
                                                                                            a15.append(" (");
                                                                                            a15.append(a14);
                                                                                            a15.append(')');
                                                                                            String sb5 = a15.toString();
                                                                                            Objects.requireNonNull(avatarActivityV22);
                                                                                            em3.q.f(sb5, str3);
                                                                                            if (i1.Companion.a(a14)) {
                                                                                                i15 = R.string.avatar_maintenance_popupdesc_unabletousethisfeature;
                                                                                            } else {
                                                                                                i15 = a14 == i1.RES_CODE_NOT_FOUND.d() ? R.string.avatar_preview_popupdesc_avatarunavailable : R.string.common_error_unknownError;
                                                                                            }
                                                                                            sz.a0 a0Var = new sz.a0(avatarActivityV22);
                                                                                            try {
                                                                                                vd3.a b14 = vd3.f.b(avatarActivityV22, i15, new rz.e(a0Var, 0));
                                                                                                b14.setCanceledOnTouchOutside(false);
                                                                                                b14.setOnCancelListener(new rz.a(a0Var, 0));
                                                                                                b14.show();
                                                                                            } catch (Exception unused) {
                                                                                            }
                                                                                        } else {
                                                                                            xVar = fVar.f168606b;
                                                                                            if (xVar != null) {
                                                                                                if (aVar2 instanceof z0.a.b) {
                                                                                                    ((z0.a.b) aVar2).f147096i = xVar.b().toString();
                                                                                                }
                                                                                                Y8(avatarActivityV22, aVar2, false, 2);
                                                                                                s1 s1Var4 = avatarActivityV22.f34745t;
                                                                                                if (s1Var4 != null) {
                                                                                                    zVar.f147077b = avatarActivityV22;
                                                                                                    zVar.f147078c = aVar2;
                                                                                                    zVar.f147079d = xVar;
                                                                                                    zVar.f147082g = i14;
                                                                                                    zVar.f147086k = 10;
                                                                                                    if (s1Var4.m(zVar) != aVar3) {
                                                                                                        avatarActivityV23 = avatarActivityV22;
                                                                                                        Unit unit3 = Unit.INSTANCE;
                                                                                                        avatarActivityV22 = avatarActivityV23;
                                                                                                    }
                                                                                                }
                                                                                                l0Var = avatarActivityV22.f34736k;
                                                                                                if (l0Var == null) {
                                                                                                    l0Var.f146843k0 = i14 == 0 ? z17 : false;
                                                                                                    s0 s0Var15 = avatarActivityV22.f34737l;
                                                                                                    if (s0Var15 != null) {
                                                                                                        String iVar = xVar.b().toString();
                                                                                                        em3.q.e(iVar, "it.metadata.toString()");
                                                                                                        if (i14 == 0) {
                                                                                                            z17 = false;
                                                                                                        }
                                                                                                        s0Var15.E(iVar, z17);
                                                                                                        Unit unit4 = Unit.INSTANCE;
                                                                                                    } else {
                                                                                                        em3.q.l(str2);
                                                                                                        throw null;
                                                                                                    }
                                                                                                } else {
                                                                                                    em3.q.l(str);
                                                                                                    throw null;
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                        aVar = aVar2;
                                                                                        avatarActivityV29 = avatarActivityV22;
                                                                                    }
                                                                                }
                                                                            } else {
                                                                                em3.q.l(str2);
                                                                                throw null;
                                                                            }
                                                                        } else {
                                                                            em3.q.l(str2);
                                                                            throw null;
                                                                        }
                                                                    }
                                                                } else {
                                                                    em3.q.l(str2);
                                                                    throw null;
                                                                }
                                                            } else {
                                                                em3.q.l(str);
                                                                throw null;
                                                            }
                                                        }
                                                        Y8(avatarActivityV29, aVar, false, 2);
                                                        return Unit.INSTANCE;
                                                    }
                                                }
                                                return aVar3;
                                            }
                                            em3.q.l(str2);
                                            throw null;
                                        }
                                        em3.q.l(str);
                                        throw null;
                                    }
                                    aVar3 = aVar8;
                                    z14 = z16;
                                    aVar = obj2;
                                    uri = obj4;
                                    str9 = str13;
                                    r24 = 0;
                                    i18 = i19;
                                    l0Var2 = avatarActivityV29.f34736k;
                                    if (l0Var2 != null) {
                                    }
                                } else {
                                    em3.q.l(str2);
                                    throw null;
                                }
                            }
                        }
                        z15 = true;
                        s0Var4 = avatarActivityV29.f34737l;
                        if (s0Var4 == null) {
                        }
                        break;
                    case 1:
                        boolean z37 = zVar.f147083h;
                        i18 = zVar.f147082g;
                        aVar7 = (z0.a) zVar.f147081f;
                        str12 = (String) zVar.f147080e;
                        str11 = (String) zVar.f147079d;
                        uri = (Uri) zVar.f147078c;
                        ResultKt.throwOnFailure(obj3);
                        str8 = "msg";
                        str = "viewModel";
                        str2 = "avatarManager";
                        z14 = z37;
                        aVar3 = aVar8;
                        avatarActivityV29 = (AvatarActivityV2) zVar.f147077b;
                        r24 = 0;
                        str9 = str12;
                        aVar = aVar7;
                        str10 = str11;
                        l0Var2 = avatarActivityV29.f34736k;
                        if (l0Var2 != null) {
                        }
                        break;
                    case 2:
                        ResultKt.throwOnFailure(obj3);
                        avatarActivityV27 = (AvatarActivityV2) zVar.f147077b;
                        str2 = "avatarManager";
                        aVar3 = aVar8;
                        o1 o1Var2 = (o1) obj3;
                        str7 = o1Var2.f146921b;
                        if (str7 == null) {
                        }
                        break;
                    case 3:
                        str7 = (String) zVar.f147078c;
                        avatarActivityV27 = (AvatarActivityV2) zVar.f147077b;
                        ResultKt.throwOnFailure(obj3);
                        str2 = "avatarManager";
                        aVar3 = aVar8;
                        Unit unit5 = Unit.INSTANCE;
                        s0Var3 = avatarActivityV27.f34737l;
                        if (s0Var3 == null) {
                        }
                        break;
                    case 4:
                        ResultKt.throwOnFailure(obj3);
                        return Unit.INSTANCE;
                    case 5:
                        i17 = zVar.f147082g;
                        aVar5 = (z0.a) zVar.f147079d;
                        avatarActivityV26 = (AvatarActivityV2) zVar.f147077b;
                        ResultKt.throwOnFailure(obj3);
                        str2 = "avatarManager";
                        aVar3 = aVar8;
                        str6 = (String) zVar.f147078c;
                        Y8(avatarActivityV26, aVar5, false, i25);
                        s1Var = avatarActivityV26.f34745t;
                        if (s1Var == null) {
                        }
                        break;
                    case 6:
                        i17 = zVar.f147082g;
                        aVar5 = (z0.a) zVar.f147079d;
                        str6 = (String) zVar.f147078c;
                        avatarActivityV25 = (AvatarActivityV2) zVar.f147077b;
                        ResultKt.throwOnFailure(obj3);
                        str2 = "avatarManager";
                        Unit unit6 = Unit.INSTANCE;
                        aVar = aVar5;
                        i16 = i17;
                        avatarActivityV29 = avatarActivityV25;
                        s0Var2 = avatarActivityV29.f34737l;
                        if (s0Var2 != null) {
                        }
                        break;
                    case 7:
                        int i28 = zVar.f147082g;
                        str4 = (String) zVar.f147078c;
                        avatarActivityV28 = (AvatarActivityV2) zVar.f147077b;
                        ResultKt.throwOnFailure(obj3);
                        str8 = "msg";
                        str = "viewModel";
                        str2 = "avatarManager";
                        aVar3 = aVar8;
                        aVar6 = (z0.a) zVar.f147079d;
                        i18 = i28;
                        aVar4 = aVar6;
                        s0Var5 = avatarActivityV28.f34737l;
                        if (s0Var5 == null) {
                        }
                        break;
                    case 8:
                        aVar4 = (z0.a) zVar.f147079d;
                        str5 = (String) zVar.f147078c;
                        avatarActivityV24 = (AvatarActivityV2) zVar.f147077b;
                        ResultKt.throwOnFailure(obj3);
                        str = "viewModel";
                        str2 = "avatarManager";
                        Unit unit22 = Unit.INSTANCE;
                        aVar = aVar4;
                        str4 = str5;
                        avatarActivityV29 = avatarActivityV24;
                        s0Var = avatarActivityV29.f34737l;
                        if (s0Var != null) {
                        }
                        break;
                    case 9:
                        i14 = zVar.f147082g;
                        avatarActivityV22 = (AvatarActivityV2) zVar.f147077b;
                        ResultKt.throwOnFailure(obj3);
                        str = "viewModel";
                        str2 = "avatarManager";
                        aVar3 = aVar8;
                        str3 = "msg";
                        aVar2 = (z0.a) zVar.f147078c;
                        c.f fVar2 = (c.f) obj3;
                        a14 = fVar2.f168605a.a();
                        if (a14 == i1.RES_CODE_SUCCESS.d()) {
                        }
                        aVar = aVar2;
                        avatarActivityV29 = avatarActivityV22;
                        Y8(avatarActivityV29, aVar, false, 2);
                        return Unit.INSTANCE;
                    case 10:
                        i14 = zVar.f147082g;
                        xVar = (uy.x) zVar.f147079d;
                        aVar2 = (z0.a) zVar.f147078c;
                        avatarActivityV23 = (AvatarActivityV2) zVar.f147077b;
                        ResultKt.throwOnFailure(obj3);
                        str = "viewModel";
                        str2 = "avatarManager";
                        Unit unit32 = Unit.INSTANCE;
                        avatarActivityV22 = avatarActivityV23;
                        l0Var = avatarActivityV22.f34736k;
                        if (l0Var == null) {
                        }
                        break;
                    default:
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
            }
        }
        zVar = new sz.z(avatarActivityV29, dVar);
        Object obj32 = zVar.f147084i;
        vl3.a aVar82 = vl3.a.COROUTINE_SUSPENDED;
        int i252 = 2;
        boolean z172 = true;
        switch (zVar.f147086k) {
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:100:0x01f2  */
    /* JADX WARNING: Removed duplicated region for block: B:10:0x0033  */
    /* JADX WARNING: Removed duplicated region for block: B:112:0x0217  */
    /* JADX WARNING: Removed duplicated region for block: B:116:0x022b  */
    /* JADX WARNING: Removed duplicated region for block: B:11:0x003c  */
    /* JADX WARNING: Removed duplicated region for block: B:126:0x024b  */
    /* JADX WARNING: Removed duplicated region for block: B:12:0x0041  */
    /* JADX WARNING: Removed duplicated region for block: B:130:0x025f  */
    /* JADX WARNING: Removed duplicated region for block: B:13:0x004a  */
    /* JADX WARNING: Removed duplicated region for block: B:14:0x0057  */
    /* JADX WARNING: Removed duplicated region for block: B:15:0x006a  */
    /* JADX WARNING: Removed duplicated region for block: B:16:0x0073  */
    /* JADX WARNING: Removed duplicated region for block: B:17:0x0080  */
    /* JADX WARNING: Removed duplicated region for block: B:18:0x008d  */
    /* JADX WARNING: Removed duplicated region for block: B:19:0x009d  */
    /* JADX WARNING: Removed duplicated region for block: B:20:0x00a6  */
    /* JADX WARNING: Removed duplicated region for block: B:21:0x00ae  */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x00f0  */
    /* JADX WARNING: Removed duplicated region for block: B:39:0x00ff  */
    /* JADX WARNING: Removed duplicated region for block: B:49:0x011f  */
    /* JADX WARNING: Removed duplicated region for block: B:54:0x012e  */
    /* JADX WARNING: Removed duplicated region for block: B:66:0x0154  */
    /* JADX WARNING: Removed duplicated region for block: B:71:0x016f  */
    /* JADX WARNING: Removed duplicated region for block: B:75:0x018f  */
    /* JADX WARNING: Removed duplicated region for block: B:79:0x01a4  */
    /* JADX WARNING: Removed duplicated region for block: B:81:0x01a8  */
    /* JADX WARNING: Removed duplicated region for block: B:8:0x002b  */
    /* JADX WARNING: Removed duplicated region for block: B:93:0x01d0  */
    /* JADX WARNING: Removed duplicated region for block: B:99:0x01ea  */
    public static final Object C8(AvatarActivityV2 avatarActivityV2, ul3.d dVar) {
        sz.b0 b0Var;
        s0 s0Var;
        s0 s0Var2;
        String str;
        s0 s0Var3;
        String str2;
        AvatarActivityV2 avatarActivityV22;
        z0.a aVar;
        s1 s1Var;
        AvatarActivityV2 avatarActivityV23;
        z0.a aVar2;
        AvatarActivityV2 avatarActivityV24;
        s1 s1Var2;
        s0 s0Var4;
        s0 s0Var5;
        s0 s0Var6;
        s0 s0Var7;
        Objects.requireNonNull(avatarActivityV2);
        if (dVar instanceof sz.b0) {
            b0Var = (sz.b0) dVar;
            int i14 = b0Var.f146746g;
            if ((i14 & Integer.MIN_VALUE) != 0) {
                b0Var.f146746g = i14 - Integer.MIN_VALUE;
                Object obj = b0Var.f146744e;
                vl3.a aVar3 = vl3.a.COROUTINE_SUSPENDED;
                switch (b0Var.f146746g) {
                    case 0:
                        ResultKt.throwOnFailure(obj);
                        l0 l0Var = avatarActivityV2.f34736k;
                        if (l0Var != null) {
                            aVar = l0Var.g6();
                            em3.q.f("resetAvatarVisibleMode() navigationInfo:" + aVar, "msg");
                            if (aVar == null) {
                                return Unit.INSTANCE;
                            }
                            if (aVar instanceof z0.a.e) {
                                avatarActivityV2.g9(aVar, false);
                                s1 s1Var3 = avatarActivityV2.f34745t;
                                if (s1Var3 != null) {
                                    b0Var.f146741b = avatarActivityV2;
                                    b0Var.f146746g = 1;
                                    if (s1Var3.m(b0Var) == aVar3) {
                                        return aVar3;
                                    }
                                }
                                s0Var7 = avatarActivityV2.f34737l;
                                if (s0Var7 == null) {
                                    l0 l0Var2 = avatarActivityV2.f34736k;
                                    if (l0Var2 != null) {
                                        s0Var7.t(l0Var2.f146838i);
                                        return Unit.INSTANCE;
                                    }
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                                em3.q.l("avatarManager");
                                throw null;
                            } else if (aVar instanceof z0.a.c) {
                                avatarActivityV2.g9(aVar, false);
                                s1 s1Var4 = avatarActivityV2.f34745t;
                                if (s1Var4 != null) {
                                    b0Var.f146741b = avatarActivityV2;
                                    b0Var.f146746g = 2;
                                    if (s1Var4.m(b0Var) == aVar3) {
                                        return aVar3;
                                    }
                                }
                                s0Var6 = avatarActivityV2.f34737l;
                                if (s0Var6 == null) {
                                    l0 l0Var3 = avatarActivityV2.f34736k;
                                    if (l0Var3 != null) {
                                        s0Var6.t(l0Var3.f146838i);
                                        return Unit.INSTANCE;
                                    }
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                                em3.q.l("avatarManager");
                                throw null;
                            } else {
                                if (aVar instanceof z0.a.b) {
                                    z0.a.b bVar = (z0.a.b) aVar;
                                    if (bVar.f147092e != null) {
                                        s0 s0Var8 = avatarActivityV2.f34737l;
                                        if (s0Var8 != null) {
                                            b0Var.f146741b = avatarActivityV2;
                                            b0Var.f146742c = aVar;
                                            b0Var.f146746g = 3;
                                            if (s0Var8.G(b0Var) == aVar3) {
                                                return aVar3;
                                            }
                                            s0Var5 = avatarActivityV2.f34737l;
                                            if (s0Var5 == null) {
                                                z0.a.e eVar = new z0.a.e(null, 1);
                                                b0Var.f146741b = avatarActivityV2;
                                                b0Var.f146742c = aVar;
                                                b0Var.f146746g = 4;
                                                if (s0Var5.A(eVar, b0Var) == aVar3) {
                                                    return aVar3;
                                                }
                                                avatarActivityV24 = avatarActivityV2;
                                                aVar2 = aVar;
                                                s0Var4 = avatarActivityV24.f34737l;
                                                if (s0Var4 == null) {
                                                    s0Var4.t(((z0.a.b) aVar2).f147092e);
                                                    b0Var.f146741b = avatarActivityV24;
                                                    b0Var.f146742c = aVar2;
                                                    b0Var.f146746g = 5;
                                                    if (um3.r0.b(200, b0Var) == aVar3) {
                                                        return aVar3;
                                                    }
                                                    avatarActivityV24.g9(aVar2, false);
                                                    s1Var2 = avatarActivityV24.f34745t;
                                                    if (s1Var2 != null) {
                                                        b0Var.f146741b = avatarActivityV24;
                                                        b0Var.f146742c = null;
                                                        b0Var.f146746g = 6;
                                                        if (s1Var2.m(b0Var) == aVar3) {
                                                            return aVar3;
                                                        }
                                                    }
                                                    avatarActivityV23 = avatarActivityV24;
                                                    avatarActivityV23.h9();
                                                } else {
                                                    em3.q.l("avatarManager");
                                                    throw null;
                                                }
                                            } else {
                                                em3.q.l("avatarManager");
                                                throw null;
                                            }
                                        } else {
                                            em3.q.l("avatarManager");
                                            throw null;
                                        }
                                    } else {
                                        str = bVar.f147096i;
                                        if (str != null) {
                                            s0 s0Var9 = avatarActivityV2.f34737l;
                                            if (s0Var9 != null) {
                                                b0Var.f146741b = avatarActivityV2;
                                                b0Var.f146742c = aVar;
                                                b0Var.f146743d = str;
                                                b0Var.f146746g = 7;
                                                if (s0Var9.G(b0Var) == aVar3) {
                                                    return aVar3;
                                                }
                                                avatarActivityV2.g9(aVar, false);
                                                s1Var = avatarActivityV2.f34745t;
                                                if (s1Var != null) {
                                                    b0Var.f146741b = avatarActivityV2;
                                                    b0Var.f146742c = str;
                                                    b0Var.f146743d = null;
                                                    b0Var.f146746g = 8;
                                                    if (s1Var.m(b0Var) == aVar3) {
                                                        return aVar3;
                                                    }
                                                    avatarActivityV22 = avatarActivityV2;
                                                    str2 = str;
                                                    str = str2;
                                                    avatarActivityV2 = avatarActivityV22;
                                                }
                                                s0Var3 = avatarActivityV2.f34737l;
                                                if (s0Var3 != null) {
                                                    s0Var3.E(str, true);
                                                    avatarActivityV2.h9();
                                                } else {
                                                    em3.q.l("avatarManager");
                                                    throw null;
                                                }
                                            } else {
                                                em3.q.l("avatarManager");
                                                throw null;
                                            }
                                        } else if (avatarActivityV2.Z8() instanceof z0.a.f) {
                                            s1 s1Var5 = avatarActivityV2.f34745t;
                                            if (s1Var5 != null) {
                                                b0Var.f146741b = avatarActivityV2;
                                                b0Var.f146746g = 9;
                                                if (s1Var5.m(b0Var) == aVar3) {
                                                    return aVar3;
                                                }
                                            }
                                            s0Var2 = avatarActivityV2.f34737l;
                                            if (s0Var2 == null) {
                                                b0Var.f146741b = null;
                                                b0Var.f146746g = 10;
                                                Object D2 = s0Var2.D(s0Var2.f146974q, b0Var);
                                                if (D2 != aVar3) {
                                                    D2 = Unit.INSTANCE;
                                                }
                                                if (D2 == aVar3) {
                                                    return aVar3;
                                                }
                                            } else {
                                                em3.q.l("avatarManager");
                                                throw null;
                                            }
                                        }
                                    }
                                } else if (aVar instanceof z0.a.f) {
                                    avatarActivityV2.g9(aVar, false);
                                    s1 s1Var6 = avatarActivityV2.f34745t;
                                    if (s1Var6 != null) {
                                        b0Var.f146741b = avatarActivityV2;
                                        b0Var.f146746g = 11;
                                        if (s1Var6.m(b0Var) == aVar3) {
                                            return aVar3;
                                        }
                                    }
                                    s0Var = avatarActivityV2.f34737l;
                                    if (s0Var == null) {
                                        b0Var.f146741b = null;
                                        b0Var.f146746g = 12;
                                        Object D3 = s0Var.D(s0Var.f146974q, b0Var);
                                        if (D3 != aVar3) {
                                            D3 = Unit.INSTANCE;
                                        }
                                        if (D3 == aVar3) {
                                            return aVar3;
                                        }
                                    } else {
                                        em3.q.l("avatarManager");
                                        throw null;
                                    }
                                }
                                return Unit.INSTANCE;
                            }
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    case 1:
                        avatarActivityV2 = (AvatarActivityV2) b0Var.f146741b;
                        ResultKt.throwOnFailure(obj);
                        s0Var7 = avatarActivityV2.f34737l;
                        if (s0Var7 == null) {
                        }
                        break;
                    case 2:
                        avatarActivityV2 = (AvatarActivityV2) b0Var.f146741b;
                        ResultKt.throwOnFailure(obj);
                        s0Var6 = avatarActivityV2.f34737l;
                        if (s0Var6 == null) {
                        }
                        break;
                    case 3:
                        AvatarActivityV2 avatarActivityV25 = (AvatarActivityV2) b0Var.f146741b;
                        ResultKt.throwOnFailure(obj);
                        aVar = (z0.a) b0Var.f146742c;
                        avatarActivityV2 = avatarActivityV25;
                        s0Var5 = avatarActivityV2.f34737l;
                        if (s0Var5 == null) {
                        }
                        break;
                    case 4:
                        aVar2 = (z0.a) b0Var.f146742c;
                        avatarActivityV24 = (AvatarActivityV2) b0Var.f146741b;
                        ResultKt.throwOnFailure(obj);
                        s0Var4 = avatarActivityV24.f34737l;
                        if (s0Var4 == null) {
                        }
                        break;
                    case 5:
                        aVar2 = (z0.a) b0Var.f146742c;
                        avatarActivityV24 = (AvatarActivityV2) b0Var.f146741b;
                        ResultKt.throwOnFailure(obj);
                        avatarActivityV24.g9(aVar2, false);
                        s1Var2 = avatarActivityV24.f34745t;
                        if (s1Var2 != null) {
                        }
                        avatarActivityV23 = avatarActivityV24;
                        avatarActivityV23.h9();
                        return Unit.INSTANCE;
                    case 6:
                        avatarActivityV23 = (AvatarActivityV2) b0Var.f146741b;
                        ResultKt.throwOnFailure(obj);
                        avatarActivityV23.h9();
                        return Unit.INSTANCE;
                    case 7:
                        aVar = (z0.a) b0Var.f146742c;
                        ResultKt.throwOnFailure(obj);
                        str = (String) b0Var.f146743d;
                        avatarActivityV2 = (AvatarActivityV2) b0Var.f146741b;
                        avatarActivityV2.g9(aVar, false);
                        s1Var = avatarActivityV2.f34745t;
                        if (s1Var != null) {
                        }
                        s0Var3 = avatarActivityV2.f34737l;
                        if (s0Var3 != null) {
                        }
                        break;
                    case 8:
                        str2 = (String) b0Var.f146742c;
                        avatarActivityV22 = (AvatarActivityV2) b0Var.f146741b;
                        ResultKt.throwOnFailure(obj);
                        str = str2;
                        avatarActivityV2 = avatarActivityV22;
                        s0Var3 = avatarActivityV2.f34737l;
                        if (s0Var3 != null) {
                        }
                        break;
                    case 9:
                        avatarActivityV2 = (AvatarActivityV2) b0Var.f146741b;
                        ResultKt.throwOnFailure(obj);
                        s0Var2 = avatarActivityV2.f34737l;
                        if (s0Var2 == null) {
                        }
                        break;
                    case 10:
                    case 12:
                        ResultKt.throwOnFailure(obj);
                        return Unit.INSTANCE;
                    case 11:
                        avatarActivityV2 = (AvatarActivityV2) b0Var.f146741b;
                        ResultKt.throwOnFailure(obj);
                        s0Var = avatarActivityV2.f34737l;
                        if (s0Var == null) {
                        }
                        break;
                    default:
                        throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
            }
        }
        b0Var = new sz.b0(avatarActivityV2, dVar);
        Object obj2 = b0Var.f146744e;
        vl3.a aVar32 = vl3.a.COROUTINE_SUSPENDED;
        switch (b0Var.f146746g) {
        }
    }

    public static final void D8(AvatarActivityV2 avatarActivityV2, int i14) {
        com.google.gson.i I2;
        l0 l0Var = avatarActivityV2.f34736k;
        if (l0Var != null) {
            YukiStickerInfo yukiStickerInfo = l0Var.f146872z;
            YukiSticker C2 = yukiStickerInfo != null ? ra.h0.C(yukiStickerInfo, i14) : null;
            if (C2 != null) {
                s0 s0Var = avatarActivityV2.f34737l;
                if (s0Var != null) {
                    com.google.gson.l avatarExtension = C2.getAvatarExtension();
                    s0Var.f146959b.h0((avatarExtension == null || (I2 = avatarExtension.I("animationScale")) == null) ? 1.0f : I2.f());
                    return;
                }
                em3.q.l("avatarManager");
                throw null;
            }
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    /* JADX WARNING: Removed duplicated region for block: B:112:0x026d  */
    /* JADX WARNING: Removed duplicated region for block: B:113:0x027a  */
    /* JADX WARNING: Removed duplicated region for block: B:20:0x0069  */
    /* JADX WARNING: Removed duplicated region for block: B:36:0x00d2  */
    /* JADX WARNING: Removed duplicated region for block: B:37:0x00e0  */
    /* JADX WARNING: Removed duplicated region for block: B:55:0x0139  */
    /* JADX WARNING: Removed duplicated region for block: B:56:0x0147  */
    /* JADX WARNING: Removed duplicated region for block: B:74:0x019f  */
    /* JADX WARNING: Removed duplicated region for block: B:75:0x01ad  */
    /* JADX WARNING: Removed duplicated region for block: B:8:0x002b  */
    /* JADX WARNING: Removed duplicated region for block: B:93:0x0205  */
    /* JADX WARNING: Removed duplicated region for block: B:94:0x0213  */
    public static final Object E8(AvatarActivityV2 avatarActivityV2, z0.a aVar, ul3.d dVar) {
        sz.e0 e0Var;
        int i14;
        l0 l0Var;
        l0 l0Var2;
        l0 l0Var3;
        l0 l0Var4;
        l0 l0Var5;
        Objects.requireNonNull(avatarActivityV2);
        if (dVar instanceof sz.e0) {
            e0Var = (sz.e0) dVar;
            int i15 = e0Var.f146773e;
            if ((i15 & Integer.MIN_VALUE) != 0) {
                e0Var.f146773e = i15 - Integer.MIN_VALUE;
                Object obj = e0Var.f146771c;
                vl3.a aVar2 = vl3.a.COROUTINE_SUSPENDED;
                i14 = e0Var.f146773e;
                if (i14 != 0) {
                    ResultKt.throwOnFailure(obj);
                    AvatarBaseFragmentV2 M8 = avatarActivityV2.M8();
                    Bundle bundle = new Bundle();
                    String simpleName = M8 != null ? M8.getClass().getSimpleName() : "AvatarActivity";
                    if (aVar instanceof z0.a.e) {
                        if (!(M8 instanceof AvatarMainFragmentV2)) {
                            bundle.putString("NAVIGATION_CALLER_KEY", simpleName);
                            AvatarMainFragmentV2 avatarMainFragmentV2 = new AvatarMainFragmentV2();
                            avatarMainFragmentV2.setArguments(bundle);
                            androidx.fragment.app.a aVar3 = new androidx.fragment.app.a(avatarActivityV2.getSupportFragmentManager());
                            zy.b bVar = avatarActivityV2.f34735j;
                            if (bVar != null) {
                                aVar3.o(((FrameLayout) bVar.f201662e).getId(), avatarMainFragmentV2, "AvatarMainFragmentV2");
                                aVar3.p(new a9.h(avatarActivityV2, avatarMainFragmentV2, 2));
                                aVar3.g();
                                l0 l0Var6 = avatarActivityV2.f34736k;
                                if (l0Var6 != null) {
                                    e0Var.f146770b = avatarActivityV2;
                                    e0Var.f146773e = 1;
                                    if (l0Var6.l7(e0Var) == aVar2) {
                                        return aVar2;
                                    }
                                } else {
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                            } else {
                                em3.q.l("binding");
                                throw null;
                            }
                        }
                    } else if (aVar instanceof z0.a.c) {
                        if (!(M8 instanceof AvatarFocusViewFragment)) {
                            bundle.putString("NAVIGATION_CALLER_KEY", simpleName);
                            AvatarFocusViewFragment avatarFocusViewFragment = new AvatarFocusViewFragment();
                            avatarFocusViewFragment.setArguments(bundle);
                            androidx.fragment.app.a aVar4 = new androidx.fragment.app.a(avatarActivityV2.getSupportFragmentManager());
                            zy.b bVar2 = avatarActivityV2.f34735j;
                            if (bVar2 != null) {
                                aVar4.o(((FrameLayout) bVar2.f201662e).getId(), avatarFocusViewFragment, "AvatarFocusViewFragment");
                                aVar4.p(new sz.e(avatarActivityV2, avatarFocusViewFragment, 0));
                                aVar4.g();
                                l0 l0Var7 = avatarActivityV2.f34736k;
                                if (l0Var7 != null) {
                                    e0Var.f146770b = avatarActivityV2;
                                    e0Var.f146773e = 2;
                                    if (l0Var7.l7(e0Var) == aVar2) {
                                        return aVar2;
                                    }
                                    l0Var4 = avatarActivityV2.f34736k;
                                    if (l0Var4 == null) {
                                    }
                                } else {
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                            } else {
                                em3.q.l("binding");
                                throw null;
                            }
                        }
                    } else if (aVar instanceof z0.a.C2780a) {
                        if (!(M8 instanceof AvatarBackgroundFragment)) {
                            bundle.putString("NAVIGATION_CALLER_KEY", simpleName);
                            AvatarBackgroundFragment avatarBackgroundFragment = new AvatarBackgroundFragment();
                            avatarBackgroundFragment.setArguments(bundle);
                            androidx.fragment.app.a aVar5 = new androidx.fragment.app.a(avatarActivityV2.getSupportFragmentManager());
                            zy.b bVar3 = avatarActivityV2.f34735j;
                            if (bVar3 != null) {
                                aVar5.o(((FrameLayout) bVar3.f201662e).getId(), avatarBackgroundFragment, "AvatarBackgroundFragment");
                                aVar5.p(new g3.b(avatarActivityV2, avatarBackgroundFragment, 2));
                                aVar5.g();
                                l0 l0Var8 = avatarActivityV2.f34736k;
                                if (l0Var8 != null) {
                                    e0Var.f146770b = avatarActivityV2;
                                    e0Var.f146773e = 3;
                                    if (l0Var8.l7(e0Var) == aVar2) {
                                        return aVar2;
                                    }
                                    l0Var3 = avatarActivityV2.f34736k;
                                    if (l0Var3 == null) {
                                    }
                                } else {
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                            } else {
                                em3.q.l("binding");
                                throw null;
                            }
                        }
                    } else if (aVar instanceof z0.a.d) {
                        if (!(M8 instanceof AvatarGestureFragment)) {
                            bundle.putString("NAVIGATION_CALLER_KEY", simpleName);
                            AvatarGestureFragment avatarGestureFragment = new AvatarGestureFragment();
                            avatarGestureFragment.setArguments(bundle);
                            androidx.fragment.app.a aVar6 = new androidx.fragment.app.a(avatarActivityV2.getSupportFragmentManager());
                            zy.b bVar4 = avatarActivityV2.f34735j;
                            if (bVar4 != null) {
                                aVar6.o(((FrameLayout) bVar4.f201662e).getId(), avatarGestureFragment, "AvatarGestureFragment");
                                aVar6.p(new g3.c(avatarActivityV2, avatarGestureFragment, 2));
                                aVar6.g();
                                l0 l0Var9 = avatarActivityV2.f34736k;
                                if (l0Var9 != null) {
                                    e0Var.f146770b = avatarActivityV2;
                                    e0Var.f146773e = 4;
                                    if (l0Var9.l7(e0Var) == aVar2) {
                                        return aVar2;
                                    }
                                    l0Var2 = avatarActivityV2.f34736k;
                                    if (l0Var2 == null) {
                                    }
                                } else {
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                            } else {
                                em3.q.l("binding");
                                throw null;
                            }
                        }
                    } else if (aVar instanceof z0.a.b) {
                        if (!(M8 instanceof AvatarCustomizationFragmentV2)) {
                            bundle.putString("NAVIGATION_CALLER_KEY", simpleName);
                            AvatarCustomizationFragmentV2 avatarCustomizationFragmentV2 = new AvatarCustomizationFragmentV2();
                            avatarCustomizationFragmentV2.setArguments(bundle);
                            androidx.fragment.app.a aVar7 = new androidx.fragment.app.a(avatarActivityV2.getSupportFragmentManager());
                            zy.b bVar5 = avatarActivityV2.f34735j;
                            if (bVar5 != null) {
                                aVar7.o(((FrameLayout) bVar5.f201662e).getId(), avatarCustomizationFragmentV2, "AvatarCustomizationFragmentV2");
                                aVar7.p(new a9.j(avatarActivityV2, avatarCustomizationFragmentV2, 1));
                                aVar7.g();
                                l0 l0Var10 = avatarActivityV2.f34736k;
                                if (l0Var10 != null) {
                                    e0Var.f146770b = avatarActivityV2;
                                    e0Var.f146773e = 5;
                                    if (l0Var10.l7(e0Var) == aVar2) {
                                        return aVar2;
                                    }
                                    l0Var = avatarActivityV2.f34736k;
                                    if (l0Var == null) {
                                    }
                                } else {
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                            } else {
                                em3.q.l("binding");
                                throw null;
                            }
                        }
                    } else if ((aVar instanceof z0.a.f) && !(M8 instanceof AvatarSuggestionFragmentV2)) {
                        bundle.putString("NAVIGATION_CALLER_KEY", simpleName);
                        AvatarSuggestionFragmentV2 avatarSuggestionFragmentV2 = new AvatarSuggestionFragmentV2();
                        avatarSuggestionFragmentV2.setArguments(bundle);
                        androidx.fragment.app.a aVar8 = new androidx.fragment.app.a(avatarActivityV2.getSupportFragmentManager());
                        zy.b bVar6 = avatarActivityV2.f34735j;
                        if (bVar6 != null) {
                            aVar8.o(((FrameLayout) bVar6.f201662e).getId(), avatarSuggestionFragmentV2, "AvatarSuggestionFragmentV2");
                            aVar8.p(new sz.d(avatarActivityV2, avatarSuggestionFragmentV2, 0));
                            aVar8.g();
                            l0 l0Var11 = avatarActivityV2.f34736k;
                            if (l0Var11 != null) {
                                r00.g gVar = r00.g.SUGGESTION_RESULT;
                                String lowerCase = String.valueOf(l0Var11.q6()).toLowerCase(Locale.ROOT);
                                em3.q.e(lowerCase, "this as java.lang.String).toLowerCase(Locale.ROOT)");
                                l0.y6(l0Var11, gVar, null, lowerCase, null, 10);
                            } else {
                                em3.q.l("viewModel");
                                throw null;
                            }
                        } else {
                            em3.q.l("binding");
                            throw null;
                        }
                    }
                    return Unit.INSTANCE;
                } else if (i14 == 1) {
                    avatarActivityV2 = (AvatarActivityV2) e0Var.f146770b;
                    ResultKt.throwOnFailure(obj);
                } else if (i14 == 2) {
                    avatarActivityV2 = (AvatarActivityV2) e0Var.f146770b;
                    ResultKt.throwOnFailure(obj);
                    l0Var4 = avatarActivityV2.f34736k;
                    if (l0Var4 == null) {
                        l0.y6(l0Var4, r00.g.FOCUS, null, null, l0Var4.m6(), 6);
                        return Unit.INSTANCE;
                    }
                    em3.q.l("viewModel");
                    throw null;
                } else if (i14 == 3) {
                    avatarActivityV2 = (AvatarActivityV2) e0Var.f146770b;
                    ResultKt.throwOnFailure(obj);
                    l0Var3 = avatarActivityV2.f34736k;
                    if (l0Var3 == null) {
                        l0.y6(l0Var3, r00.g.BACKGROUND, null, null, l0Var3.m6(), 6);
                        return Unit.INSTANCE;
                    }
                    em3.q.l("viewModel");
                    throw null;
                } else if (i14 == 4) {
                    avatarActivityV2 = (AvatarActivityV2) e0Var.f146770b;
                    ResultKt.throwOnFailure(obj);
                    l0Var2 = avatarActivityV2.f34736k;
                    if (l0Var2 == null) {
                        l0.y6(l0Var2, r00.g.GESTURE, null, null, l0Var2.m6(), 6);
                        return Unit.INSTANCE;
                    }
                    em3.q.l("viewModel");
                    throw null;
                } else if (i14 == 5) {
                    avatarActivityV2 = (AvatarActivityV2) e0Var.f146770b;
                    ResultKt.throwOnFailure(obj);
                    l0Var = avatarActivityV2.f34736k;
                    if (l0Var == null) {
                        l0.y6(l0Var, r00.g.CUSTOMIZATION, null, null, l0Var.m6(), 6);
                        return Unit.INSTANCE;
                    }
                    em3.q.l("viewModel");
                    throw null;
                } else {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                l0Var5 = avatarActivityV2.f34736k;
                if (l0Var5 == null) {
                    l0.y6(l0Var5, r00.g.MAIN, null, null, l0Var5.m6(), 6);
                    return Unit.INSTANCE;
                }
                em3.q.l("viewModel");
                throw null;
            }
        }
        e0Var = new sz.e0(avatarActivityV2, dVar);
        Object obj2 = e0Var.f146771c;
        vl3.a aVar22 = vl3.a.COROUTINE_SUSPENDED;
        i14 = e0Var.f146773e;
        if (i14 != 0) {
        }
        l0Var5 = avatarActivityV2.f34736k;
        if (l0Var5 == null) {
        }
    }

    public static final void F8(AvatarActivityV2 avatarActivityV2) {
        l0 l0Var = avatarActivityV2.f34736k;
        if (l0Var != null) {
            l0Var.W6(false);
            l0 l0Var2 = avatarActivityV2.f34736k;
            if (l0Var2 != null) {
                s0 s0Var = avatarActivityV2.f34737l;
                if (s0Var != null) {
                    l0Var2.P6(s0Var.p());
                    l0 l0Var3 = avatarActivityV2.f34736k;
                    if (l0Var3 != null) {
                        l0Var3.f146843k0 = false;
                        l0Var3.f7(Boolean.TRUE);
                        return;
                    }
                    em3.q.l("viewModel");
                    throw null;
                }
                em3.q.l("avatarManager");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    public static /* synthetic */ void Y8(AvatarActivityV2 avatarActivityV2, z0 z0Var, boolean z14, int i14) {
        if ((i14 & 2) != 0) {
            z14 = false;
        }
        avatarActivityV2.X8(z0Var, z14);
    }

    public static final void x8(AvatarActivityV2 avatarActivityV2, a aVar) {
        um3.r<a> rVar = avatarActivityV2.H;
        if (rVar != null) {
            rVar.l(aVar);
        }
        avatarActivityV2.H = null;
    }

    public static final g1 y8(AvatarActivityV2 avatarActivityV2) {
        return (g1) avatarActivityV2.f34743r.getValue();
    }

    public static final void z8(AvatarActivityV2 avatarActivityV2, String str) {
        Objects.requireNonNull(avatarActivityV2);
        em3.q.f(str, "msg");
    }

    @Override // com.linecorp.line.avatar.v2.gesture.AvatarGestureFragment.a
    public void A1() {
        Z8();
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            com.android.billingclient.api.z.m(l0Var.f146850o, null);
            l0Var.u6(null);
            com.android.billingclient.api.z.m(l0Var.f146856r, null);
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void A7(a00.g gVar) {
        er2.g gVar2;
        if (gVar instanceof g.e) {
            StringBuilder a14 = fq1.a.a("onCustomizationClickContentItem() ", "Removable category:");
            a14.append(gVar.a().getTitle());
            a14.append('(');
            a14.append(gVar.a().getId());
            a14.append(')');
            em3.q.f(a14.toString(), "msg");
            s1 s1Var = this.G;
            if (s1Var != null) {
                s1Var.c(null);
            }
            s0 s0Var = this.f34737l;
            if (s0Var != null) {
                int id4 = gVar.a().getId();
                gr2.o oVar = s0Var.f146959b;
                boolean J2 = oVar.J("removeAvatarContent");
                sz.g.a(b.e.a("removeAvatarContent() categoryId:", id4, " scriptReady:"), !J2, oVar);
                if (!J2) {
                    HashMap<Integer, Integer> hashMap = oVar.E;
                    Integer num = hashMap != null ? hashMap.get(Integer.valueOf(id4)) : null;
                    if (!(num == null || (gVar2 = oVar.f77697k) == null)) {
                        int intValue = num.intValue();
                        YukiEffectService yukiEffectService = gVar2.f69145a;
                        if (yukiEffectService != null) {
                            yukiEffectService.removeAvatarContent(intValue);
                        }
                    }
                }
                l0 l0Var = this.f34736k;
                if (l0Var != null) {
                    r00.g gVar3 = r00.g.CUSTOMIZATION;
                    r00.c cVar = r00.c.PLAY;
                    r00.d N8 = N8(gVar);
                    l0 l0Var2 = this.f34736k;
                    if (l0Var2 != null) {
                        l0Var.x6(gVar3, cVar, N8, l0Var2.m6());
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("avatarManager");
                throw null;
            }
        } else if (gVar instanceof g.d) {
            StringBuilder a15 = fq1.a.a("onCustomizationClickContentItem() ", "ControlPoint category:");
            a15.append(gVar.a().getTitle());
            a15.append('(');
            a15.append(gVar.a().getId());
            a15.append(')');
            em3.q.f(a15.toString(), "msg");
            u9(new s.b((g.d) gVar));
            l0 l0Var3 = this.f34736k;
            if (l0Var3 != null) {
                r00.g gVar4 = r00.g.CUSTOMIZATION;
                r00.c cVar2 = r00.c.CONTROL_POINT;
                r00.d N82 = N8(gVar);
                l0 l0Var4 = this.f34736k;
                if (l0Var4 != null) {
                    l0Var3.x6(gVar4, cVar2, N82, l0Var4.m6());
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else if (gVar instanceof g.c) {
            StringBuilder a16 = fq1.a.a("onCustomizationClickContentItem() ", "Content:");
            g.c cVar3 = (g.c) gVar;
            a16.append(cVar3.f84e.getStickerId());
            a16.append("category:");
            a16.append(gVar.a().getTitle());
            a16.append('(');
            a16.append(gVar.a().getId());
            a16.append(')');
            em3.q.f(a16.toString(), "msg");
            if (!cVar3.f85f) {
                l9(cVar3.f84e.getStickerId());
                l0 l0Var5 = this.f34736k;
                if (l0Var5 != null) {
                    r00.g gVar5 = r00.g.CUSTOMIZATION;
                    r00.c cVar4 = r00.c.PLAY;
                    r00.d N83 = N8(gVar);
                    l0 l0Var6 = this.f34736k;
                    if (l0Var6 != null) {
                        l0Var5.x6(gVar5, cVar4, N83, l0Var6.m6());
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
        } else if (gVar instanceof g.a) {
            StringBuilder a17 = fq1.a.a("onCustomizationClickContentItem() ", "ColorControl category:");
            a17.append(gVar.a().getTitle());
            a17.append('(');
            a17.append(gVar.a().getId());
            a17.append(')');
            em3.q.f(a17.toString(), "msg");
            u9(new s.a((g.a) gVar));
            l0 l0Var7 = this.f34736k;
            if (l0Var7 != null) {
                r00.g gVar6 = r00.g.CUSTOMIZATION;
                r00.c cVar5 = r00.c.COLOR_EDIT;
                r00.d N84 = N8(gVar);
                l0 l0Var8 = this.f34736k;
                if (l0Var8 != null) {
                    l0Var7.x6(gVar6, cVar5, N84, l0Var8.m6());
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        }
    }

    @Override // com.linecorp.line.avatar.v2.background.AvatarBackgroundFragment.a
    public void B6(m00.a aVar) {
        em3.q.f(aVar, "item");
        if (aVar instanceof a.C1778a) {
            k9(new jr2.d(((a.C1778a) aVar).f109455b, jr2.e.bground, null, null, null, 0, 60), new n(this, aVar));
        } else {
            boolean z14 = aVar instanceof a.b;
        }
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void B7() {
        f9();
    }

    @Override // com.linecorp.line.avatar.v2.main.popup.AvatarCreateStickerFragment.a
    public void C3() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.S6(false);
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                String v14 = l0Var2.f146822a.v();
                em3.q.f("onAvatarCreateStickerClickCreate() createAvatarStickerUrl:" + v14, "msg");
                V8(v14, null);
                l0 l0Var3 = this.f34736k;
                if (l0Var3 != null) {
                    l0.w6(l0Var3, r00.g.STICKER_MAKER, r00.c.START, null, null, null, 28);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.gesture.AvatarGestureFragment.a
    public void D2(float f14) {
        s0 s0Var = this.f34737l;
        if (s0Var != null) {
            s0Var.f146959b.x0(gr2.j.Rotation, 0.0f, f14, 0.0f);
            l0 l0Var = this.f34736k;
            if (l0Var != null) {
                m00.b value = l0Var.f146850o.getValue();
                if (value != null) {
                    value.f109464c = f14;
                }
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    l0.w6(l0Var2, r00.g.GESTURE, r00.c.ROTATE, null, null, null, 28);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("avatarManager");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void D7(YukiStickerCategory yukiStickerCategory, String str, a00.i iVar) {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.V.put(new a00.e(yukiStickerCategory.getId(), str), iVar);
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void E2() {
        l0 l0Var = this.f34736k;
        if (l0Var == null) {
            em3.q.l("viewModel");
            throw null;
        } else if (sm3.r.r(l0Var.U5().f34550p, r00.f.StickerMaker.d(), true)) {
            J8();
        } else {
            Z8();
        }
    }

    @Override // com.linecorp.line.avatar.v2.gesture.AvatarGestureFragment.a
    public void E7() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            m00.b value = l0Var.f146850o.getValue();
            if (value == null) {
                rz.i.d(rz.i.f140915a, this, R.string.avatar_error_toast_cropviewerfail, 0, 0, 0, 0, false, 124);
                return;
            }
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                um3.g.d(j2.e.g(l0Var2), null, 0, new p(value, this, null), 3, null);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void F1() {
        J8();
    }

    @Override // com.linecorp.line.avatar.v2.suggestion.AvatarSuggestionFragmentV2.a
    public void F5() {
        X8(new z0.a.b(null, false, null, null, null, false, 32), false);
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            r00.g gVar = r00.g.SUGGESTION_RESULT;
            r00.c cVar = r00.c.EDIT;
            if (this.f34737l != null) {
                l0.w6(l0Var, gVar, cVar, String.valueOf(0), null, null, 24);
            } else {
                em3.q.l("avatarManager");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void G6() {
        f9();
    }

    public final void G8() {
        uz.t tVar;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            a00.d value = l0Var.H.getValue();
            if (value != null) {
                if (value.f68f) {
                    tVar = uz.t.SMALL;
                } else {
                    tVar = uz.t.LARGE;
                }
                s0 s0Var = this.f34737l;
                if (s0Var != null) {
                    s0Var.z(tVar.d(), true);
                    l0 l0Var2 = this.f34736k;
                    if (l0Var2 == null) {
                        em3.q.l("viewModel");
                        throw null;
                    } else if (tVar != l0Var2.G.getValue()) {
                        l0Var2.G.setValue(tVar);
                    }
                } else {
                    em3.q.l("avatarManager");
                    throw null;
                }
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    public final void H8() {
        uz.t tVar = uz.t.NORMAL;
        s0 s0Var = this.f34737l;
        if (s0Var != null) {
            s0Var.z(tVar.d(), true);
            l0 l0Var = this.f34736k;
            if (l0Var == null) {
                em3.q.l("viewModel");
                throw null;
            } else if (tVar != l0Var.G.getValue()) {
                l0Var.G.setValue(tVar);
            }
        } else {
            em3.q.l("avatarManager");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void I3(boolean z14) {
        r00.c cVar;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            r00.g gVar = r00.g.FOCUS;
            if (z14) {
                cVar = r00.c.EDIT_FACE;
            } else {
                cVar = r00.c.EDIT_COSTUME;
            }
            if (l0Var != null) {
                Integer valueOf = Integer.valueOf(l0Var.l6());
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    l0.w6(l0Var, gVar, cVar, null, valueOf, l0Var2.m6(), 4);
                    d9(z14);
                    return;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    public final void I8() {
        if (!K8().e(this)) {
            f fVar = new f(this);
            a.b bVar = new a.b(this);
            bVar.d(R.string.chat_keyboard_msgstickertab_network_error_desc);
            bVar.f(R.string.chat_keyboard_msgstickertab_retry_button, new sz.a(fVar, 0));
            bVar.e(R.string.avatar_common_popupbutton_cancel, null);
            bVar.a().show();
            return;
        }
        l0 l0Var = this.f34736k;
        if (l0Var == null) {
            em3.q.l("viewModel");
            throw null;
        } else if (l0Var.U5().f34543i) {
            um3.g.d(androidx.lifecycle.e0.c(this), null, 0, new sz.i(this, null), 3, null);
        } else {
            um3.r<a> rVar = this.H;
            if (rVar != null) {
                rVar.c(null);
            }
            um3.r<a> a14 = com.android.billingclient.api.i0.a(null, 1);
            this.H = a14;
            if (this.f34736k != null) {
                boolean g14 = ((bz.c) rb.a.d(this, bz.c.f15891e0)).g(this);
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    um3.g.d(j2.e.g(l0Var2), null, 0, new g(this, g14, a14, null), 3, null);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        }
    }

    public final void J8() {
        StringBuilder a14 = b.d.a("finishAvatar : callerType=");
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            a14.append(l0Var.U5().f34537c);
            a14.append(" waitUEN=");
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                a14.append(l0Var2.f146834g);
                em3.q.f(a14.toString(), "msg");
                finish();
                return;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.gesture.AvatarGestureFragment.a
    public void K4() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            m00.b value = l0Var.f146856r.getValue();
            if (value != null) {
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    m00.c e64 = l0Var2.e6(value);
                    l0 l0Var3 = this.f34736k;
                    if (l0Var3 != null) {
                        um3.g.d(j2.e.g(l0Var3), null, 0, new o(value, this, e64, null), 3, null);
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void K5(List<String> list, String str, float f14, boolean z14, String str2) {
        er2.g gVar;
        YukiEffectService yukiEffectService;
        s0 s0Var = this.f34737l;
        if (s0Var != null) {
            if (list == null) {
                list = ql3.w.f133304b;
            }
            gr2.o oVar = s0Var.f146959b;
            Object[] array = list.toArray(new String[0]);
            Objects.requireNonNull(array, "null cannot be cast to non-null type kotlin.Array<T of kotlin.collections.ArraysKt__ArraysJVMKt.toTypedArray>");
            String[] strArr = (String[]) array;
            boolean J2 = oVar.J("setAvatarContentColor[]");
            StringBuilder sb4 = new StringBuilder();
            sb4.append("setAvatarContentColor() color:");
            sb4.append(str);
            sb4.append(" colorFactor:");
            sb4.append(f14);
            sb4.append(" parts:");
            z1.a.a(sb4, Arrays.toString(strArr), " channel:", str2, " confirm:");
            sb4.append(z14);
            sb4.append(" scriptReady:");
            sz.g.a(sb4, !J2, oVar);
            if (!J2 && (gVar = oVar.f77697k) != null && (yukiEffectService = gVar.f69145a) != null) {
                yukiEffectService.setAvatarContentColor(str, f14, strArr, str2, z14);
                return;
            }
            return;
        }
        em3.q.l("avatarManager");
        throw null;
    }

    /* JADX DEBUG: Failed to insert an additional move for type inference into block B:32:0x005a */
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r0v4, types: [java.util.List] */
    /* JADX WARN: Type inference failed for: r0v5, types: [ql3.w] */
    /* JADX WARN: Type inference failed for: r0v7, types: [java.util.ArrayList] */
    /* JADX WARNING: Unknown variable types count: 1 */
    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void K6() {
        ?? r04;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            String str = l0Var.f146838i;
            List<m00.d> value = l0Var.f146836h.getValue();
            if (value != null) {
                ArrayList arrayList = new ArrayList(ql3.q.p(value, 10));
                Iterator<T> it3 = value.iterator();
                while (it3.hasNext()) {
                    arrayList.add(it3.next().f109479a);
                }
                r04 = new ArrayList();
                Iterator it4 = arrayList.iterator();
                while (it4.hasNext()) {
                    Object next = it4.next();
                    if (!em3.q.b((String) next, "-1")) {
                        r04.add(next);
                    }
                }
            } else {
                r04 = ql3.w.f133304b;
            }
            if (!rz.i.f140915a.b(this)) {
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    l0Var2.D0.setValue(Boolean.FALSE);
                    pd3.d.c().s(uf3.a.AVATAR_FOCUS_SET_AS_MAIN_TOOLTIP_SHOWN, Boolean.TRUE);
                    l0 l0Var3 = this.f34736k;
                    if (l0Var3 != null) {
                        um3.g.d(j2.e.g(l0Var3), null, 0, new t(this, r04, str, null), 3, null);
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    public final bz.c K8() {
        return (bz.c) this.f34742q.getValue();
    }

    @Override // com.linecorp.line.avatar.v2.guide.AvatarMainGuide.a
    public void L0() {
        s9();
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0.w6(l0Var, r00.g.MAIN_GUIDE, r00.c.GUIDE_OK, null, null, null, 28);
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.popup.AvatarTermOfUseFragment.a
    public void L1() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.U6(false);
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.gesture.AvatarGestureFragment.a
    public void L5(m00.b bVar) {
        em3.q.f(bVar, "item");
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            m00.b value = l0Var.f146850o.getValue();
            boolean z14 = false;
            if (value != null && value.f109462a == bVar.f109462a) {
                z14 = true;
            }
            if (z14) {
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    m00.b value2 = l0Var2.f146856r.getValue();
                    if (value2 != null && bVar.f109462a != value2.f109462a) {
                        l0 l0Var3 = this.f34736k;
                        if (l0Var3 != null) {
                            com.android.billingclient.api.z.m(l0Var3.f146856r, null);
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                l0 l0Var4 = this.f34736k;
                if (l0Var4 != null) {
                    um3.g.d(j2.e.g(l0Var4), null, 0, new q(bVar, this, null), 3, null);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    public final AvatarIntentHelper$IntentParams L8(Intent intent) {
        if (intent == null) {
            intent = getIntent();
        }
        AvatarIntentHelper$IntentParams avatarIntentHelper$IntentParams = (AvatarIntentHelper$IntentParams) intent.getParcelableExtra("avatar.param");
        return avatarIntentHelper$IntentParams == null ? new AvatarIntentHelper$IntentParams(1, new a.e()) : avatarIntentHelper$IntentParams;
    }

    public final AvatarBaseFragmentV2 M8() {
        FragmentManager supportFragmentManager = getSupportFragmentManager();
        int size = supportFragmentManager.Q().size();
        while (true) {
            size--;
            if (-1 >= size) {
                return null;
            }
            if (supportFragmentManager.Q().get(size) instanceof AvatarBaseFragmentV2) {
                Fragment fragment = supportFragmentManager.Q().get(size);
                Objects.requireNonNull(fragment, "null cannot be cast to non-null type com.linecorp.line.avatar.v2.AvatarBaseFragmentV2");
                return (AvatarBaseFragmentV2) fragment;
            }
        }
    }

    @Override // com.linecorp.line.avatar.v2.suggestion.AvatarSuggestionFragmentV2.a
    public void N2() {
        l0 l0Var = this.f34736k;
        if (l0Var == null) {
            em3.q.l("viewModel");
            throw null;
        } else if (l0Var.U5().f34543i) {
            um3.g.d(androidx.lifecycle.e0.c(this), null, 0, new sz.i(this, null), 3, null);
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                r00.g gVar = r00.g.SUGGESTION_RESULT;
                r00.c cVar = r00.c.ADD;
                if (this.f34737l != null) {
                    l0.w6(l0Var2, gVar, cVar, String.valueOf(0), null, null, 24);
                } else {
                    em3.q.l("avatarManager");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            throw new UnsupportedOperationException("creating avatar directly on suggestion result is not supported");
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:54:0x00a5  */
    /* JADX WARNING: Removed duplicated region for block: B:55:0x00ab  */
    /* JADX WARNING: Removed duplicated region for block: B:57:0x00ae  */
    /* JADX WARNING: Removed duplicated region for block: B:58:0x00b4  */
    /* JADX WARNING: Removed duplicated region for block: B:60:0x00b7  */
    public final r00.d N8(a00.g gVar) {
        r00.e eVar;
        Pair pair;
        String str;
        String str2;
        T t14;
        ArrayList<YukiStickerCategory> subCategories;
        T t15;
        boolean z14;
        ArrayList<YukiStickerCategory> subCategories2;
        l0 l0Var = this.f34736k;
        String str3 = null;
        if (l0Var != null) {
            a00.d dVar = l0Var.Z5(this, null).f106h;
            if (dVar != null && dVar.f68f) {
                eVar = r00.e.DECORATION;
            } else {
                eVar = r00.e.APPEARANCE;
            }
            YukiStickerCategory yukiStickerCategory = dVar != null ? dVar.f65c : null;
            YukiStickerCategory a14 = gVar.a();
            if (em3.q.b(yukiStickerCategory, a14)) {
                pair = TuplesKt.to(null, null);
            } else {
                if ((yukiStickerCategory == null || (subCategories2 = yukiStickerCategory.getSubCategories()) == null || !subCategories2.contains(a14)) ? false : true) {
                    pair = TuplesKt.to(a14, null);
                } else {
                    if (yukiStickerCategory == null || (subCategories = yukiStickerCategory.getSubCategories()) == null) {
                        t14 = null;
                    } else {
                        Iterator<T> it3 = subCategories.iterator();
                        while (true) {
                            if (!it3.hasNext()) {
                                t15 = null;
                                break;
                            }
                            t15 = it3.next();
                            ArrayList<YukiStickerCategory> subCategories3 = t15.getSubCategories();
                            if (subCategories3 == null || !subCategories3.contains(a14)) {
                                z14 = false;
                                continue;
                            } else {
                                z14 = true;
                                continue;
                            }
                            if (z14) {
                                break;
                            }
                        }
                        t14 = t15;
                    }
                    pair = TuplesKt.to(t14, a14);
                }
            }
            YukiStickerCategory yukiStickerCategory2 = (YukiStickerCategory) pair.component1();
            YukiStickerCategory yukiStickerCategory3 = (YukiStickerCategory) pair.component2();
            if (gVar instanceof g.c) {
                str2 = ((g.c) gVar).f84e.getName();
            } else if (gVar instanceof g.e) {
                str2 = "noItem";
            } else {
                str = null;
                String title = yukiStickerCategory == null ? yukiStickerCategory.getTitle() : null;
                String title2 = yukiStickerCategory2 == null ? yukiStickerCategory2.getTitle() : null;
                if (yukiStickerCategory3 != null) {
                    str3 = yukiStickerCategory3.getTitle();
                }
                return new r00.d(eVar, title, title2, str3, str, null, null);
            }
            str = str2;
            if (yukiStickerCategory == null) {
            }
            if (yukiStickerCategory2 == null) {
            }
            if (yukiStickerCategory3 != null) {
            }
            return new r00.d(eVar, title, title2, str3, str, null, null);
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void O1() {
        X8(new z0.a.c(null, true, 1), false);
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            r00.g gVar = r00.g.MAIN;
            r00.c cVar = r00.c.BUTTON_FOCUSED;
            if (l0Var != null) {
                l0.w6(l0Var, gVar, cVar, null, null, l0Var.m6(), 12);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    public final void O8(r00.b bVar) {
        float[] fArr;
        String L;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            z0.a value = l0Var.f146830e.getValue();
            if (value != null && (fArr = value.f147088b) != null && (L = K8().L(this)) != null) {
                i0 i0Var = new i0();
                int i14 = this.f34733h;
                i0Var.f68710b = i14;
                i0 i0Var2 = new i0();
                int i15 = (i14 / 9) * 16;
                i0Var2.f68710b = i15;
                int i16 = this.f34734i;
                if (i15 > i16) {
                    i0Var2.f68710b = i16;
                    i0Var.f68710b = (i16 * 9) / 16;
                }
                StringBuilder a14 = f1.g.a("[handleExport] filePath: ", L, " origin: (");
                a14.append(this.f34733h);
                a14.append(", ");
                a14.append(this.f34734i);
                a14.append("), target: (");
                a14.append(i0Var.f68710b);
                a14.append(", ");
                a14.append(i0Var2.f68710b);
                a14.append(')');
                em3.q.f(a14.toString(), "msg");
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    s1 d14 = um3.g.d(j2.e.g(l0Var2), null, 0, new i(this, i0Var, i0Var2, L, bVar, null), 3, null);
                    this.f34749x = d14;
                    ((x1) d14).N(false, true, new j(this, fArr));
                    return;
                }
                em3.q.l("viewModel");
                throw null;
            }
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void P5() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            String str = l0Var.f146822a.h() ? "https://lcs-beta.line-beta.me/studio/app/" : "https://creator.line.me/studio/app/";
            em3.q.f("onFocusViewClickReturnToStickerMaker() returnToStickerMakerUrl:" + str, "msg");
            V8(str, null);
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                r00.g gVar = r00.g.FOCUS;
                r00.c cVar = r00.c.RETURN_STICKER_MAKER;
                if (l0Var2 != null) {
                    Integer valueOf = Integer.valueOf(l0Var2.l6());
                    l0 l0Var3 = this.f34736k;
                    if (l0Var3 != null) {
                        l0.w6(l0Var2, gVar, cVar, null, valueOf, l0Var3.m6(), 4);
                        Z8();
                        return;
                    }
                    em3.q.l("viewModel");
                    throw null;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    public final void P8() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.J6(false);
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    public final void Q8() {
        Fragment J2 = getSupportFragmentManager().J("AvatarMainGuide");
        AvatarMainGuide avatarMainGuide = J2 instanceof AvatarMainGuide ? (AvatarMainGuide) J2 : null;
        if (avatarMainGuide != null) {
            avatarMainGuide.dismiss();
        }
    }

    @Override // com.linecorp.line.avatar.v2.loading.AvatarShortLoadFragmentV2.a
    public void R0() {
        S8(500, new y(this));
    }

    @Override // com.linecorp.line.avatar.v2.guide.AvatarFocusGuide.a
    public void R1() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.B0 = true;
            P8();
            Z8();
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void R6() {
        ClipDescription primaryClipDescription;
        ClipData primaryClip;
        ClipData.Item itemAt;
        CharSequence text;
        boolean f14 = K8().f(this);
        boolean o14 = K8().o(this);
        if (f14 || o14) {
            rz.i iVar = rz.i.f140915a;
            s0 s0Var = this.f34737l;
            if (s0Var == null) {
                em3.q.l("avatarManager");
                throw null;
            } else if (!iVar.a(this, s0Var.h())) {
                Objects.requireNonNull((b00.a) this.f34740o.getValue());
                Object systemService = getSystemService("clipboard");
                ClipboardManager clipboardManager = systemService instanceof ClipboardManager ? (ClipboardManager) systemService : null;
                boolean z14 = false;
                String obj = (clipboardManager == null || !clipboardManager.hasPrimaryClip() || (primaryClipDescription = clipboardManager.getPrimaryClipDescription()) == null || !primaryClipDescription.hasMimeType("text/plain") || (primaryClip = clipboardManager.getPrimaryClip()) == null || (itemAt = primaryClip.getItemAt(0)) == null || (text = itemAt.getText()) == null) ? null : text.toString();
                em3.q.f("[createAvatarWithClipData] " + obj, "msg");
                if (obj == null || obj.length() == 0) {
                    z14 = true;
                }
                if (z14) {
                    rz.i.d(iVar, this, R.string.temp_avatar_clipboard_fail_copy, 0, 0, 0, 0, false, 124);
                    return;
                }
                em3.q.f("[saveWithMetadata] metadata: " + obj, "msg");
                um3.r<a> rVar = this.H;
                if (rVar != null) {
                    rVar.c(null);
                }
                um3.r<a> a14 = com.android.billingclient.api.i0.a(null, 1);
                this.H = a14;
                l0 l0Var = this.f34736k;
                if (l0Var != null) {
                    um3.g.d(j2.e.g(l0Var), null, 0, new sz.c0(this, obj, a14, null), 3, null);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
        }
    }

    public final void R8() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.c7(Boolean.FALSE);
            s1 s1Var = this.f34749x;
            if (s1Var != null) {
                s1Var.c(null);
            }
            this.f34749x = null;
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void S2(int i14) {
        l9(i14);
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void S7() {
        a00.d dVar;
        r00.c cVar;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            a00.d value = l0Var.H.getValue();
            if (value != null) {
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    List<a00.d> X5 = l0Var2.X5();
                    if (value.f68f) {
                        Iterator it3 = ((ArrayList) X5).iterator();
                        while (it3.hasNext()) {
                            dVar = (a00.d) it3.next();
                            if (!dVar.f68f) {
                            }
                        }
                        throw new NoSuchElementException("Collection contains no element matching the predicate.");
                    }
                    Iterator it4 = ((ArrayList) X5).iterator();
                    while (it4.hasNext()) {
                        dVar = (a00.d) it4.next();
                        if (dVar.f68f) {
                        }
                    }
                    throw new NoSuchElementException("Collection contains no element matching the predicate.");
                    l0 l0Var3 = this.f34736k;
                    if (l0Var3 != null) {
                        if (!em3.q.b(dVar, l0Var3.H.getValue())) {
                            l0Var3.H.setValue(dVar);
                        }
                        l0 l0Var4 = this.f34736k;
                        if (l0Var4 != null) {
                            r00.g gVar = r00.g.CUSTOMIZATION;
                            if (dVar.f68f) {
                                cVar = r00.c.CATEGORY_COSTUME;
                            } else {
                                cVar = r00.c.CATEGORY_FACE;
                            }
                            l0.w6(l0Var4, gVar, cVar, null, null, l0Var4.m6(), 12);
                            return;
                        }
                        em3.q.l("viewModel");
                        throw null;
                    }
                    em3.q.l("viewModel");
                    throw null;
                }
                em3.q.l("viewModel");
                throw null;
            }
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    public final void S8(long j14, dm3.a<Unit> aVar) {
        m9(new k(this, j14, aVar));
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void T0(m00.f fVar) {
        int i14 = fVar.f109484a;
        int i15 = fVar.f109485b;
        float f14 = fVar.f109486c;
        if (i15 != i14) {
            f14 -= 1.0f;
        }
        s0 s0Var = this.f34737l;
        if (s0Var != null) {
            s0Var.f146959b.x0(gr2.j.TranslationXNormal, (f14 * -0.7f) + 0.5f, 0.0f, 0.0f);
            return;
        }
        em3.q.l("avatarManager");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.suggestion.AvatarSuggestionFragmentV2.a
    public void T1() {
        Z8();
    }

    public final void T8() {
        bz.c K8 = K8();
        uy.e eVar = uy.e.AVATAR_MAIN;
        d.a aVar = dz.d.Companion;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            this.E.a(K8.t(this, uy.f.FullViewMode, eVar, aVar.a(l0Var.k6())), null);
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void U2(boolean z14) {
        r00.c cVar;
        boolean z15;
        l0 l0Var = this.f34736k;
        T t14 = null;
        if (l0Var != null) {
            r00.g gVar = r00.g.MAIN;
            if (z14) {
                cVar = r00.c.EDIT_FACE;
            } else {
                cVar = r00.c.EDIT_COSTUME;
            }
            if (l0Var != null) {
                l0.w6(l0Var, gVar, cVar, null, null, l0Var.m6(), 12);
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    Iterator<T> it3 = l0Var2.X5().iterator();
                    while (true) {
                        if (!it3.hasNext()) {
                            break;
                        }
                        T next = it3.next();
                        if (next.f68f == (!z14)) {
                            z15 = true;
                            continue;
                        } else {
                            z15 = false;
                            continue;
                        }
                        if (z15) {
                            t14 = next;
                            break;
                        }
                    }
                    T t15 = t14;
                    if (t15 != null) {
                        n9(t15.f66d.f57f);
                    }
                    d9(z14);
                    return;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.guide.AvatarFocusGuide.a
    public void U4() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.B0 = true;
            pd3.d.c().s(uf3.a.AVATAR_FOCUS_GUIDE_SHOWN, Boolean.TRUE);
            P8();
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                l0Var2.s6(true);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    public final void U8(boolean z14) {
        String e14 = z14 ? dz.d.PROFILE_HOME.e() : null;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            um3.g.d(j2.e.g(l0Var), null, 0, new l(this, e14, null), 3, null);
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    public final void V8(String str, Map<String, String> map) {
        try {
            Uri.Builder buildUpon = Uri.parse(str).buildUpon();
            if (map != null) {
                LinkedHashMap linkedHashMap = new LinkedHashMap();
                for (Map.Entry<String, String> entry : map.entrySet()) {
                    if (entry.getValue() != null) {
                        linkedHashMap.put(entry.getKey(), entry.getValue());
                    }
                }
                for (Map.Entry entry2 : linkedHashMap.entrySet()) {
                    buildUpon.appendQueryParameter((String) entry2.getKey(), (String) entry2.getValue());
                }
            }
            Uri build = buildUpon.build();
            em3.q.f("launchScheme() uri:" + build, "msg");
            Intent intent = new Intent("android.intent.action.VIEW", build);
            rz.l.a(intent, this);
            startActivity(intent);
        } catch (Exception unused) {
        }
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void W1() {
        g.a aVar;
        er2.g gVar;
        YukiEffectService yukiEffectService;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            g.a value = l0Var.P.getValue();
            if (value != null) {
                List<String> list = value.f80e.f54c;
                if (list != null) {
                    s0 s0Var = this.f34737l;
                    if (s0Var != null) {
                        Objects.requireNonNull(s0Var);
                        gr2.o oVar = s0Var.f146959b;
                        Object[] array = list.toArray(new String[0]);
                        Objects.requireNonNull(array, "null cannot be cast to non-null type kotlin.Array<T of kotlin.collections.ArraysKt__ArraysJVMKt.toTypedArray>");
                        String[] strArr = (String[]) array;
                        boolean J2 = oVar.J("resetPartColor");
                        StringBuilder a14 = b.d.a("resetPartColor() parts:");
                        a14.append(Arrays.toString(strArr));
                        a14.append(" scriptReady:");
                        sz.g.a(a14, !J2, oVar);
                        if (!(J2 || (gVar = oVar.f77697k) == null || (yukiEffectService = gVar.f69145a) == null)) {
                            yukiEffectService.resetPartColor(strArr);
                        }
                    } else {
                        em3.q.l("avatarManager");
                        throw null;
                    }
                }
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    uz.s value2 = l0Var2.Q.getValue();
                    if ((value2 instanceof s.a) && (aVar = ((s.a) value2).f168819a) != null) {
                        l0 l0Var3 = this.f34736k;
                        if (l0Var3 != null) {
                            r00.g gVar2 = r00.g.CUSTOMIZATION;
                            r00.c cVar = r00.c.COLOR_EDIT_RESET;
                            r00.d N8 = N8(aVar);
                            l0 l0Var4 = this.f34736k;
                            if (l0Var4 != null) {
                                l0Var3.x6(gVar2, cVar, N8, l0Var4.m6());
                            } else {
                                em3.q.l("viewModel");
                                throw null;
                            }
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.promotion.AvatarPromotionFragmentV2.a
    public void X3() {
        e9();
    }

    @Override // com.linecorp.line.avatar.v2.main.popup.AvatarTermOfUseFragment.a
    public void X6() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.U6(false);
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    public final void X8(z0 z0Var, boolean z14) {
        boolean z15 = z0Var instanceof z0.a.e;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            boolean z16 = z15 || z14;
            Objects.requireNonNull(l0Var);
            em3.q.f(z0Var, "info");
            if (!em3.q.b(z0Var, ql3.u.c0(l0Var.f146832f))) {
                if (z16) {
                    l0Var.f146832f.clear();
                }
                l0Var.f146832f.add(z0Var);
                if (z0Var instanceof z0.a) {
                    l0Var.D6((z0.a) z0Var);
                }
            }
            em3.q.f("navigate() last:" + z0Var + " clear:" + z16 + " stack:" + ql3.u.Z(l0Var.f146832f, null, null, null, 0, null, null, 63), "msg");
            g9(z0Var, false);
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void Y1(String str, float f14) {
        List<jr2.h> a14;
        em3.q.f("[onCustomizationControlPointSeekBarStopChanging] key: " + str + ", progress: " + f14, "msg");
        s0 s0Var = this.f34737l;
        jr2.f fVar = null;
        if (s0Var != null) {
            s0Var.x(str, f14, true);
            l0 l0Var = this.f34736k;
            if (l0Var != null) {
                o0<jr2.f> o0Var = l0Var.O;
                jr2.f value = o0Var.getValue();
                if (!(value == null || (a14 = value.a()) == null)) {
                    ArrayList arrayList = new ArrayList(ql3.q.p(a14, 10));
                    for (T t14 : a14) {
                        if (em3.q.b(t14.f(), str)) {
                            t14 = (T) jr2.h.a(t14, 0.0f, 0.0f, 0.0f, null, 0, f14, 31);
                        }
                        arrayList.add(t14);
                    }
                    fVar = new jr2.f(arrayList);
                }
                o0Var.setValue(fVar);
                l0Var.N = true;
                return;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("avatarManager");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void Y7(int i14, boolean z14) {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            um3.g.d(j2.e.g(l0Var), null, 0, new u(this, i14, z14, null), 3, null);
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.loading.AvatarLoadFragmentV2.b
    public void Z3(String str) {
        em3.q.f(str, "loadState");
        em3.q.f("onLoadFragmentError() loadState:" + str, "msg");
        s0 s0Var = this.f34737l;
        if (s0Var != null) {
            a9(new u.a(0, null, new cz.r(3, s0Var.p() ? a1.a.a("Timeout full loading. ", str) : "")));
        } else {
            em3.q.l("avatarManager");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void Z5() {
        boolean f14 = K8().f(this);
        boolean o14 = K8().o(this);
        if (f14 || o14) {
            l0 l0Var = this.f34736k;
            if (l0Var == null) {
                em3.q.l("viewModel");
                throw null;
            } else if (!sm3.r.u(l0Var.f146838i)) {
                l0 l0Var2 = this.f34736k;
                if (l0Var2 == null) {
                    em3.q.l("viewModel");
                    throw null;
                } else if (!em3.q.b(l0Var2.f146838i, "-1")) {
                    f.a aVar = new f.a(this);
                    qk.d0 d0Var = new qk.d0(this, 2);
                    AlertController.b bVar = aVar.f6151a;
                    bVar.f6075p = new String[]{"delete", "copy clipboard"};
                    bVar.f6077r = d0Var;
                    bVar.f6082w = 0;
                    bVar.f6081v = true;
                    aVar.create().show();
                }
            }
        }
    }

    public final z0 Z8() {
        l0 l0Var = this.f34736k;
        z0 z0Var = null;
        if (l0Var != null) {
            List<z0> list = l0Var.f146832f;
            em3.q.f(list, "<this>");
            if (!list.isEmpty()) {
                z0Var = list.remove(ql3.p.e(list));
            }
            z0 z0Var2 = z0Var;
            z0 z0Var3 = (z0) ql3.u.c0(l0Var.f146832f);
            if (z0Var3 instanceof z0.a) {
                l0Var.D6((z0.a) z0Var3);
            }
            StringBuilder sb4 = new StringBuilder();
            sb4.append("navigateBack() removed:");
            sb4.append(z0Var2);
            sb4.append(" last:");
            sb4.append(z0Var3);
            sb4.append(" stack:");
            ay.g.a(sb4, ql3.u.Z(l0Var.f146832f, null, null, null, 0, null, null, 63), "msg");
            if (z0Var3 == null) {
                J8();
            } else {
                g9(z0Var3, true);
            }
            return z0Var3;
        }
        em3.q.l("viewModel");
        throw null;
    }

    public final void a9(cz.u uVar) {
        em3.q.f("errorInfo observe : errorInfo = " + uVar + " (already has error: " + this.I + ')', "msg");
        if (!this.I) {
            boolean z14 = true;
            this.I = true;
            l0 l0Var = this.f34736k;
            if (l0Var != null) {
                l0Var.T6(Boolean.TRUE);
                S8(0, null);
                boolean z15 = uVar instanceof u.d;
                int i14 = R.string.avatar_maintenance_popupdesc_unabletousethisfeature;
                if (z15) {
                    m1 m1Var = ((u.d) uVar).f62003c;
                    if (m1Var != null) {
                        int i15 = m1Var.f146902a;
                        int i16 = m1Var.f146903b;
                        StringBuilder a14 = b.d.a("[showSuggestionErrorDialog] error: ");
                        a14.append(n1.b(i15));
                        a14.append(", code: ");
                        a14.append(i16);
                        a14.append(", ");
                        em3.q.f(a14.toString(), "msg");
                        int i17 = b.$EnumSwitchMapping$4[j.q.e(i15)];
                        if (i17 == 1 || i17 == 2) {
                            i14 = R.string.avatar_suggestioncamera_errordesc_onlyoneface;
                        } else if (i17 == 3) {
                            c00.g gVar = c00.g.f15972e;
                            Pair<Integer, Integer> pair = c00.g.f15973f;
                            if (i16 == 510) {
                                i14 = R.string.avatar_loading_popupdesc_serverreject;
                            } else {
                                int intValue = pair.getFirst().intValue();
                                if (i16 > pair.getSecond().intValue() || intValue > i16) {
                                    z14 = false;
                                }
                                if (!z14) {
                                    i14 = R.string.avatar_suggestioncamera_errordesc_unabletodetect;
                                }
                            }
                        } else if (i17 == 4) {
                            i14 = R.string.common_error_unknownError;
                        } else {
                            throw new NoWhenBranchMatchedException();
                        }
                        sz.h0 h0Var = new sz.h0(this);
                        try {
                            vd3.a b14 = vd3.f.b(this, i14, new rz.e(h0Var, 0));
                            b14.setCanceledOnTouchOutside(false);
                            b14.setOnCancelListener(new rz.a(h0Var, 0));
                            b14.show();
                        } catch (Exception unused) {
                        }
                    }
                } else if (uVar instanceof u.c) {
                    o9(R.string.common_error_unknownError);
                } else if (uVar instanceof u.a) {
                    cz.r rVar = ((u.a) uVar).f61995c;
                    if (rVar != null) {
                        int i18 = b.$EnumSwitchMapping$3[j.q.e(rVar.f61990a)];
                        if (i18 == 1 || i18 == 2 || i18 == 3) {
                            o9(R.string.avatar_common_popupdesc_unabletoload);
                            String str = rVar.f61991b;
                            if (!sm3.r.u(str)) {
                                String d14 = a1.NELO_ERROR_CODE_AVATAR_SCRIPT.d();
                                StringBuilder a15 = b.d.a("avatar/");
                                a15.append(cz.q.b(rVar.f61990a));
                                String sb4 = a15.toString();
                                em3.q.f(d14, "errorCode");
                                new fg3.a(2, d14, null, str, sb4, null, 32).b(new a.C0910a(this, 1, a.C0910a.b.DAY));
                            }
                        }
                    }
                } else if (uVar instanceof u.b) {
                    if (em3.q.b(((u.b) uVar).f61998c, "/am/v1/avatar/create")) {
                        i14 = R.string.avatar_main_toast_unabletoaddtocollection;
                    } else if (!i1.Companion.a(uVar.a())) {
                        i14 = em3.q.b(((u.b) uVar).f61998c, "/am/v1/avatar/order/delete") ? R.string.avatar_main_popupdesc_temperror : R.string.avatar_common_popupdesc_unabletoload;
                    }
                    o9(i14);
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        }
    }

    @Override // com.linecorp.line.avatar.v2.background.AvatarBackgroundFragment.a
    public void b3() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            m00.a value = l0Var.f146844l.getValue();
            if (value == null) {
                rz.i.d(rz.i.f140915a, this, R.string.avatar_error_toast_cropviewerfail, 0, 0, 0, 0, false, 124);
                return;
            }
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                um3.g.d(j2.e.g(l0Var2), null, 0, new m(value, this, null), 3, null);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.promotion.AvatarPromotionFragmentV2.a
    public void b4(int i14) {
        String str;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.d7(this, i14);
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                com.linecorp.line.avatar.v2.promotion.d dVar = (com.linecorp.line.avatar.v2.promotion.d) ql3.u.S(l0Var2.f146866w, i14);
                if (dVar == null || (str = dVar.f35117b) == null) {
                    str = "";
                }
                l0 l0Var3 = this.f34736k;
                if (l0Var3 != null) {
                    l0.y6(l0Var3, r00.g.PROMOTION, str, null, null, 12);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void b5() {
        c9();
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            r00.g gVar = r00.g.MAIN;
            r00.c cVar = r00.c.GESTURE;
            if (l0Var != null) {
                l0.w6(l0Var, gVar, cVar, null, null, l0Var.m6(), 12);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.loading.AvatarLoadFragmentV2.b
    public void b6() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            AvatarLoadFragmentV2.a value = l0Var.f146853p0.getValue();
            Boolean valueOf = value != null ? Boolean.valueOf(value.f35003c) : null;
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                z0 h64 = l0Var2.h6();
                em3.q.f("onLoadFragmentComplete() waitAvatarCreated:" + valueOf + " navigationInfo:" + h64, "msg");
                l0 l0Var3 = this.f34736k;
                if (l0Var3 != null) {
                    if (l0Var3.f146843k0) {
                        rz.i.d(rz.i.f140915a, this, R.string.avatar_common_toast_avataradded, 0, 0, 0, 0, false, 124);
                        l0 l0Var4 = this.f34736k;
                        if (l0Var4 != null) {
                            l0Var4.f146843k0 = false;
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    }
                    m9(new sz.k(this, 500, new v(this, h64)));
                    return;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    public final void b9() {
        X8(new z0.a.C2780a(null, 1), false);
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            Objects.requireNonNull(l0Var);
            if (l0Var.f146872z != null) {
                long W5 = l0Var.W5();
                Context applicationContext = getApplicationContext();
                em3.q.e(applicationContext, "context.applicationContext");
                applicationContext.getSharedPreferences(xi3.a.AVATAR.key, 0).edit().putLong("avatar.background.lastNewMarkEndDate", W5).apply();
                l0Var.g7(this);
                return;
            }
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.promotion.AvatarPromotionFragmentV2.a
    public void c2(String str, String str2) {
        em3.q.f(str, "urlScheme");
        em3.q.f(str2, "name");
        em3.q.f("[onPromotionClickConfirm] urlScheme -> " + str, "msg");
        if (!sm3.r.u(str)) {
            l0 l0Var = this.f34736k;
            if (l0Var != null) {
                l0.w6(l0Var, r00.g.PROMOTION, r00.c.CHECK, str2, null, null, 24);
                V8(str, null);
                return;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    public final void c9() {
        X8(new z0.a.d(false, null, 3), false);
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            Objects.requireNonNull(l0Var);
            if (l0Var.f146872z != null) {
                long f64 = l0Var.f6();
                Context applicationContext = getApplicationContext();
                em3.q.e(applicationContext, "context.applicationContext");
                applicationContext.getSharedPreferences(xi3.a.AVATAR.key, 0).edit().putLong("avatar.gesture.lastNewMarkEndDate", f64).apply();
                l0Var.j7(this);
                return;
            }
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void d6() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            hb.w wVar = l0Var.R;
            List list = (List) wVar.f80756c;
            em3.q.f(list, "<this>");
            if (!list.isEmpty()) {
                ((List) wVar.f80757d).add((jr2.c) list.remove(ql3.p.e(list)));
                jr2.c cVar = (jr2.c) ql3.u.b0((List) wVar.f80756c);
                l0Var.k7();
                s0 s0Var = this.f34737l;
                if (s0Var != null) {
                    s0Var.u(cVar);
                    l0 l0Var2 = this.f34736k;
                    if (l0Var2 != null) {
                        r00.g gVar = r00.g.CUSTOMIZATION;
                        r00.c cVar2 = r00.c.UNDO;
                        if (l0Var2 != null) {
                            l0.w6(l0Var2, gVar, cVar2, null, null, l0Var2.m6(), 12);
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    em3.q.l("avatarManager");
                    throw null;
                }
            } else {
                throw new NoSuchElementException("List is empty.");
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.view.AvatarProgressDialogFragment.b
    public void d7() {
        l0 l0Var = this.f34736k;
        if (l0Var == null) {
            em3.q.l("viewModel");
            throw null;
        } else if (l0Var.f146837h0) {
            R8();
        }
    }

    public final void d9(boolean z14) {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            um3.g.d(j2.e.g(l0Var), null, 0, new a0(this, z14, null), 3, null);
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void e1() {
        StringBuilder a14 = b.d.a("onMainClickTakeProfile() avatarId:");
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            ay.g.a(a14, l0Var.f146838i, "msg");
            l0 l0Var2 = this.f34736k;
            if (l0Var2 == null) {
                em3.q.l("viewModel");
                throw null;
            } else if (!em3.q.b(l0Var2.f146838i, "-1")) {
                U8(true);
                l0 l0Var3 = this.f34736k;
                if (l0Var3 != null) {
                    r00.g gVar = r00.g.MAIN;
                    r00.c cVar = r00.c.SET_PROFILE;
                    if (l0Var3 != null) {
                        l0.w6(l0Var3, gVar, cVar, null, null, l0Var3.m6(), 12);
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void e7() {
        l0 l0Var = this.f34736k;
        if (l0Var == null) {
            em3.q.l("viewModel");
            throw null;
        } else if (sm3.r.r(l0Var.U5().f34550p, r00.f.StickerMaker.d(), true)) {
            J8();
        } else {
            Z8();
        }
    }

    public final void e9() {
        AvatarBaseFragmentV2 M8 = M8();
        AvatarMainFragmentV2 avatarMainFragmentV2 = M8 instanceof AvatarMainFragmentV2 ? (AvatarMainFragmentV2) M8 : null;
        if (avatarMainFragmentV2 != null) {
            avatarMainFragmentV2.Y4().cancel();
            int a54 = avatarMainFragmentV2.a5();
            int color = avatarMainFragmentV2.getResources().getColor(R.color.linegray900_20, null);
            j0 j0Var = avatarMainFragmentV2.f35014b;
            em3.q.d(j0Var);
            j0Var.f201844x.setGuidelineEnd(a54);
            j0Var.f201841u.setCardBackgroundColor(color);
            j0Var.f201842v.setAlpha(1.0f);
            avatarMainFragmentV2.Y4().addListener(new i00.v(avatarMainFragmentV2));
            avatarMainFragmentV2.Y4().start();
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void f5() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            r00.g gVar = r00.g.FOCUS;
            r00.c cVar = r00.c.CAPTURE;
            if (l0Var != null) {
                Integer valueOf = Integer.valueOf(l0Var.l6());
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    l0.w6(l0Var, gVar, cVar, null, valueOf, l0Var2.m6(), 4);
                    O8(r00.b.AVATAR_MAIN_FOCUSED);
                    return;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void f8(a00.j jVar) {
        r00.e eVar;
        T t14;
        ArrayList<YukiStickerCategory> subCategories;
        T t15;
        boolean z14;
        if (!jVar.f117c) {
            l9(jVar.f116b.getStickerId());
            l0 l0Var = this.f34736k;
            if (l0Var != null) {
                a00.d dVar = l0Var.Z5(this, null).f106h;
                if (dVar != null && dVar.f68f) {
                    eVar = r00.e.DECORATION;
                } else {
                    eVar = r00.e.APPEARANCE;
                }
                YukiStickerCategory yukiStickerCategory = dVar != null ? dVar.f65c : null;
                YukiStickerCategory yukiStickerCategory2 = jVar.f115a;
                if (yukiStickerCategory == null || (subCategories = yukiStickerCategory.getSubCategories()) == null) {
                    t14 = null;
                } else {
                    Iterator<T> it3 = subCategories.iterator();
                    while (true) {
                        if (!it3.hasNext()) {
                            t15 = null;
                            break;
                        }
                        t15 = it3.next();
                        ArrayList<YukiStickerCategory> subCategories2 = t15.getSubCategories();
                        if (subCategories2 == null || !subCategories2.contains(yukiStickerCategory2)) {
                            z14 = false;
                            continue;
                        } else {
                            z14 = true;
                            continue;
                        }
                        if (z14) {
                            break;
                        }
                    }
                    t14 = t15;
                }
                r00.d dVar2 = new r00.d(eVar, yukiStickerCategory != null ? yukiStickerCategory.getTitle() : null, t14 != null ? t14.getTitle() : null, yukiStickerCategory2.getTitle(), jVar.f116b.getName(), null, null);
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    l0Var2.x6(r00.g.CUSTOMIZATION, r00.c.PLAY, dVar2, l0Var2.m6());
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        }
    }

    public final void f9() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            uz.s value = l0Var.Q.getValue();
            if (value instanceof s.b) {
                u9(new s.c(null, 1));
            } else if (value instanceof s.a) {
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    jr2.c cVar = (jr2.c) ql3.u.b0((List) l0Var2.R.f80756c);
                    s0 s0Var = this.f34737l;
                    if (s0Var != null) {
                        s0Var.u(cVar);
                        u9(new s.c(null, 1));
                        return;
                    }
                    em3.q.l("avatarManager");
                    throw null;
                }
                em3.q.l("viewModel");
                throw null;
            } else {
                Z8();
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    public void finish() {
        StringBuilder a14 = b.d.a("[finish] uen: ");
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            a14.append(l0Var.f146834g);
            a14.append(", avatarCreated: ");
            a14.append(this.f34747v);
            em3.q.f(a14.toString(), "msg");
            Intent intent = new Intent();
            intent.putExtra("avatar.created", this.f34747v);
            intent.putExtra("avatar.profile.video.uploaded", this.A);
            intent.putExtra("avatar.metadata", this.f34748w);
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                if (!l0Var2.f146834g) {
                    w8(-1, intent);
                } else {
                    w8(0, intent);
                }
                super.finish();
                return;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.loading.AvatarLoadFragmentV2.b
    public void g2() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            z0 h64 = l0Var.h6();
            StringBuilder a14 = b.d.a("onLoadFragmentBackPressed() avatarReady:");
            s0 s0Var = this.f34737l;
            if (s0Var != null) {
                a14.append(s0Var.p());
                a14.append(" lastNavigationInfo: ");
                a14.append(h64);
                a14.append(" parseParamJob:");
                boolean z14 = true;
                if (this.f34746u == null) {
                    z14 = false;
                }
                a14.append(z14);
                em3.q.f(a14.toString(), "msg");
                s1 s1Var = this.f34746u;
                if (s1Var != null) {
                    s1Var.c(null);
                }
                this.f34746u = null;
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    l0Var2.f146829d0.setValue(null);
                    if (Z8() != null) {
                        m9(new sz.k(this, 100, null));
                        return;
                    }
                    return;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("avatarManager");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    public final void g9(z0 z0Var, boolean z14) {
        s1 s1Var = this.G;
        if (s1Var != null) {
            s1Var.c(null);
        }
        if (z0Var instanceof z0.a) {
            s1 s1Var2 = this.f34745t;
            if (s1Var2 != null) {
                s1Var2.c(null);
            }
            l0 l0Var = this.f34736k;
            if (l0Var != null) {
                this.f34745t = um3.g.d(j2.e.g(l0Var), null, 0, new b0(this, z0Var, z14, null), 3, null);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        }
    }

    public final void h9() {
        l0 l0Var = this.f34736k;
        Unit unit = null;
        if (l0Var != null) {
            a00.d value = l0Var.H.getValue();
            if (value != null) {
                int id4 = value.f65c.getId();
                List<String> list = value.f67e;
                String str = value.f66d.f57f;
                s0 s0Var = this.f34737l;
                if (s0Var != null) {
                    s0Var.v(id4, list);
                    s0 s0Var2 = this.f34737l;
                    if (s0Var2 != null) {
                        s0Var2.C(str);
                        l0 l0Var2 = this.f34736k;
                        if (l0Var2 != null) {
                            uz.s value2 = l0Var2.Q.getValue();
                            if (value2 != null) {
                                u9(value2);
                                unit = Unit.INSTANCE;
                            }
                            if (unit == null) {
                                G8();
                                return;
                            }
                            return;
                        }
                        em3.q.l("viewModel");
                        throw null;
                    }
                    em3.q.l("avatarManager");
                    throw null;
                }
                em3.q.l("avatarManager");
                throw null;
            }
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void i1(boolean z14) {
        em3.q.f("onCustomizationExpandContentView() isExpand:" + z14, "msg");
        if (z14) {
            G8();
        } else {
            H8();
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void i2() {
        StringBuilder a14 = b.d.a("onFocusViewClickSetAsProfile() avatarId:");
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            ay.g.a(a14, l0Var.f146838i, "msg");
            l0 l0Var2 = this.f34736k;
            if (l0Var2 == null) {
                em3.q.l("viewModel");
                throw null;
            } else if (!em3.q.b(l0Var2.f146838i, "-1")) {
                l0 l0Var3 = this.f34736k;
                if (l0Var3 != null) {
                    r00.g gVar = r00.g.FOCUS;
                    r00.c cVar = r00.c.SET_PROFILE;
                    if (l0Var3 != null) {
                        Integer valueOf = Integer.valueOf(l0Var3.l6());
                        l0 l0Var4 = this.f34736k;
                        if (l0Var4 != null) {
                            l0.w6(l0Var3, gVar, cVar, null, valueOf, l0Var4.m6(), 4);
                            U8(false);
                            return;
                        }
                        em3.q.l("viewModel");
                        throw null;
                    }
                    em3.q.l("viewModel");
                    throw null;
                }
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.popup.AvatarCreateStickerFragment.a
    public void i5() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.S6(false);
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                l0.w6(l0Var2, r00.g.STICKER_MAKER, r00.c.CANCEL, null, null, null, 28);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.suggestion.AvatarSuggestionFragmentV2.a
    public void i7() {
        Z8();
    }

    public final boolean i9(String str) {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            z0.a g64 = l0Var.g6();
            s0 s0Var = this.f34737l;
            if (s0Var != null) {
                em3.q.f(str, "avatarId");
                boolean contains = s0Var.f146975r.contains(str);
                StringBuilder a14 = b.d.a("[selectAvatar] previous avatar id: ");
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    z1.a.a(a14, l0Var2.f146838i, ", current id: ", str, ", visible mode: ");
                    a14.append(g64);
                    a14.append(", forceReload: ");
                    a14.append(contains);
                    a14.append("  list: ");
                    s0 s0Var2 = this.f34737l;
                    if (s0Var2 != null) {
                        a14.append(ql3.l.l0(s0Var2.j()));
                        em3.q.f(a14.toString(), "msg");
                        if (g64 instanceof z0.a.f) {
                            return false;
                        }
                        l0 l0Var3 = this.f34736k;
                        if (l0Var3 == null) {
                            em3.q.l("viewModel");
                            throw null;
                        } else if (!em3.q.b(l0Var3.f146838i, str) || contains) {
                            if (em3.q.b(str, "-1")) {
                                s0 s0Var3 = this.f34737l;
                                if (s0Var3 != null) {
                                    s0Var3.m();
                                } else {
                                    em3.q.l("avatarManager");
                                    throw null;
                                }
                            } else {
                                s0 s0Var4 = this.f34737l;
                                if (s0Var4 != null) {
                                    s0Var4.t(str);
                                } else {
                                    em3.q.l("avatarManager");
                                    throw null;
                                }
                            }
                            l0 l0Var4 = this.f34736k;
                            if (l0Var4 != null) {
                                l0Var4.f146838i = str;
                                return true;
                            }
                            em3.q.l("viewModel");
                            throw null;
                        } else {
                            if (em3.q.b(str, "-1")) {
                                s0 s0Var5 = this.f34737l;
                                if (s0Var5 != null) {
                                    s0Var5.m();
                                } else {
                                    em3.q.l("avatarManager");
                                    throw null;
                                }
                            }
                            return false;
                        }
                    } else {
                        em3.q.l("avatarManager");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("avatarManager");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.guide.AvatarMainGuide.a
    public void j5() {
        Z8();
    }

    @Override // com.linecorp.line.avatar.v2.main.popup.AvatarCreateStickerFragment.a
    public void j6() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.S6(false);
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                l0.w6(l0Var2, r00.g.STICKER_MAKER, r00.c.CANCEL, null, null, null, 28);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:101:0x01c1  */
    /* JADX WARNING: Removed duplicated region for block: B:132:? A[RETURN, SYNTHETIC] */
    /* JADX WARNING: Removed duplicated region for block: B:66:0x0104  */
    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void j8() {
        boolean z14;
        g.a aVar;
        List<String> list;
        er2.g gVar;
        jr2.j[] jVarArr;
        List<jr2.j> list2;
        er2.g gVar2;
        YukiEffectService yukiEffectService;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            uz.s value = l0Var.Q.getValue();
            if (value != null) {
                if (value instanceof s.b) {
                    g.d dVar = ((s.b) value).f168820a;
                    if (dVar != null) {
                        l0 l0Var2 = this.f34736k;
                        if (l0Var2 != null) {
                            if (!l0Var2.N) {
                                u9(new s.c(null, 1));
                            } else if (l0Var2 != null) {
                                l0Var2.H6(new s.c(null, 1));
                                s0 s0Var = this.f34737l;
                                if (s0Var != null) {
                                    gr2.m mVar = gr2.m.AvatarVisibleModeAppearanceModify;
                                    em3.q.f(mVar, "avatarVisibleMode");
                                    gr2.o oVar = s0Var.f146959b;
                                    boolean J2 = oVar.J("applyAvatarVisibleMode");
                                    StringBuilder sb4 = new StringBuilder();
                                    sb4.append("applyAvatarVisibleMode() mode:");
                                    sb4.append(mVar);
                                    sb4.append(" scriptReady:");
                                    sz.g.a(sb4, !J2, oVar);
                                    if (!(J2 || (gVar2 = oVar.f77697k) == null || (yukiEffectService = gVar2.f69145a) == null)) {
                                        yukiEffectService.applyAvatarVisibleMode(mVar.d());
                                    }
                                    G8();
                                } else {
                                    em3.q.l("avatarManager");
                                    throw null;
                                }
                            } else {
                                em3.q.l("viewModel");
                                throw null;
                            }
                            l0 l0Var3 = this.f34736k;
                            if (l0Var3 != null) {
                                r00.g gVar3 = r00.g.CUSTOMIZATION;
                                r00.c cVar = r00.c.CONTROL_POINT_SAVE;
                                r00.d N8 = N8(dVar);
                                l0 l0Var4 = this.f34736k;
                                if (l0Var4 != null) {
                                    l0Var3.x6(gVar3, cVar, N8, l0Var4.m6());
                                } else {
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                            } else {
                                em3.q.l("viewModel");
                                throw null;
                            }
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    }
                } else if (value instanceof s.a) {
                    l0 l0Var5 = this.f34736k;
                    if (l0Var5 != null) {
                        Set<String> keySet = l0Var5.L.keySet();
                        if (!(keySet instanceof Collection) || !keySet.isEmpty()) {
                            Iterator<T> it3 = keySet.iterator();
                            while (true) {
                                if (!it3.hasNext()) {
                                    break;
                                }
                                T next = it3.next();
                                Map<String, List<jr2.j>> value2 = l0Var5.K.getValue();
                                Set O0 = (value2 == null || (list2 = value2.get(next)) == null) ? null : ql3.u.O0(list2);
                                List<jr2.j> list3 = l0Var5.L.get(next);
                                if (!em3.q.b(O0, list3 != null ? ql3.u.O0(list3) : null)) {
                                    z14 = true;
                                    break;
                                }
                            }
                            if (z14) {
                                l0 l0Var6 = this.f34736k;
                                if (l0Var6 != null) {
                                    g.a value3 = l0Var6.P.getValue();
                                    if (value3 != null) {
                                        l0 l0Var7 = this.f34736k;
                                        if (l0Var7 != null) {
                                            Map<String, List<jr2.j>> value4 = l0Var7.K.getValue();
                                            if (!(value4 == null || (list = value3.f80e.f54c) == null)) {
                                                ArrayList arrayList = new ArrayList(ql3.q.p(list, 10));
                                                for (T t14 : list) {
                                                    List<jr2.j> list4 = value4.get(t14);
                                                    if (list4 != null) {
                                                        Object[] array = list4.toArray(new jr2.j[0]);
                                                        Objects.requireNonNull(array, "null cannot be cast to non-null type kotlin.Array<T of kotlin.collections.ArraysKt__ArraysJVMKt.toTypedArray>");
                                                        jVarArr = (jr2.j[]) array;
                                                    } else {
                                                        jVarArr = new jr2.j[0];
                                                    }
                                                    arrayList.add(new jr2.k(t14, jVarArr));
                                                }
                                                s0 s0Var2 = this.f34737l;
                                                if (s0Var2 != null) {
                                                    gr2.o oVar2 = s0Var2.f146959b;
                                                    Object[] array2 = arrayList.toArray(new jr2.k[0]);
                                                    Objects.requireNonNull(array2, "null cannot be cast to non-null type kotlin.Array<T of kotlin.collections.ArraysKt__ArraysJVMKt.toTypedArray>");
                                                    jr2.l lVar = new jr2.l((jr2.k[]) array2);
                                                    boolean J3 = oVar2.J("setAvatarPartColors");
                                                    sz.g.a(qk.h1.a("setAvatarPartColors() confirm:", true, " scriptReady:"), !J3, oVar2);
                                                    if (!J3 && (gVar = oVar2.f77697k) != null) {
                                                        String o14 = new Gson().o(lVar);
                                                        YukiEffectService yukiEffectService2 = gVar.f69145a;
                                                        if (yukiEffectService2 != null) {
                                                            yukiEffectService2.setAvatarPartColors(o14, true);
                                                        }
                                                    }
                                                } else {
                                                    em3.q.l("avatarManager");
                                                    throw null;
                                                }
                                            }
                                        } else {
                                            em3.q.l("viewModel");
                                            throw null;
                                        }
                                    }
                                } else {
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                            }
                            u9(new s.c(null, 1));
                            aVar = ((s.a) value).f168819a;
                            if (aVar == null) {
                                l0 l0Var8 = this.f34736k;
                                if (l0Var8 != null) {
                                    r00.g gVar4 = r00.g.CUSTOMIZATION;
                                    r00.c cVar2 = r00.c.COLOR_EDIT_SAVE;
                                    r00.d N82 = N8(aVar);
                                    l0 l0Var9 = this.f34736k;
                                    if (l0Var9 != null) {
                                        l0Var8.x6(gVar4, cVar2, N82, l0Var9.m6());
                                        return;
                                    } else {
                                        em3.q.l("viewModel");
                                        throw null;
                                    }
                                } else {
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                            } else {
                                return;
                            }
                        }
                        z14 = false;
                        if (z14) {
                        }
                        u9(new s.c(null, 1));
                        aVar = ((s.a) value).f168819a;
                        if (aVar == null) {
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else if (value instanceof s.c) {
                    I8();
                    l0 l0Var10 = this.f34736k;
                    if (l0Var10 != null) {
                        r00.g gVar5 = r00.g.CUSTOMIZATION;
                        r00.c cVar3 = r00.c.DONE;
                        if (l0Var10 != null) {
                            l0.w6(l0Var10, gVar5, cVar3, null, null, l0Var10.m6(), 12);
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                }
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    public final void j9(AvatarBaseFragmentV2 avatarBaseFragmentV2, boolean z14) {
        StringBuilder a14 = b.d.a("[sendGaScreenIfNeeded] resumed: ");
        a14.append(this.f34744s);
        em3.q.f(a14.toString(), "msg");
        if (this.f34744s) {
            if (z14) {
                l0 l0Var = this.f34736k;
                if (l0Var == null) {
                    em3.q.l("viewModel");
                    throw null;
                } else if (l0Var.f146833f0) {
                    return;
                }
            }
            GAScreenTracking gAScreenTracking = (GAScreenTracking) avatarBaseFragmentV2.getClass().getAnnotation(GAScreenTracking.class);
            if (gAScreenTracking != null) {
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    String simpleName = avatarBaseFragmentV2.getClass().getSimpleName();
                    StringBuilder a15 = b.d.a("[sendGaScreen] target screen : ");
                    a15.append(gAScreenTracking.screenName());
                    a15.append(", default : ");
                    a15.append(simpleName);
                    a15.append(", skipGa : ");
                    a15.append(l0Var2.f146833f0);
                    em3.q.f(a15.toString(), "msg");
                    if (l0Var2.f146833f0) {
                        l0Var2.f146833f0 = false;
                    } else {
                        f2.b.l(gAScreenTracking, simpleName);
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
        }
    }

    @Override // com.linecorp.line.avatar.v2.guide.AvatarMainGuide.a
    public void k3() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0.w6(l0Var, r00.g.MAIN_GUIDE, r00.c.GUIDE_NEXT, null, null, null, 28);
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.view.AvatarProgressDialogFragment.b
    public void k6() {
        R8();
    }

    public final void k9(jr2.d dVar, dm3.l<? super Boolean, Unit> lVar) {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            Map<Integer, Integer> value = l0Var.I.getValue();
            boolean z14 = false;
            if (value != null && value.containsKey(Integer.valueOf(dVar.b()))) {
                z14 = true;
            }
            if (!z14) {
                s1 s1Var = this.G;
                if (s1Var != null) {
                    s1Var.c(null);
                }
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    this.G = um3.g.d(j2.e.g(l0Var2), null, 0, new d0(this, dVar, lVar, null), 3, null);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void l2() {
        l0 l0Var = this.f34736k;
        if (l0Var == null) {
            em3.q.l("viewModel");
            throw null;
        } else if (!em3.q.b(l0Var.f146838i, "-1")) {
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                um3.g.d(j2.e.g(l0Var2), null, 0, new w(this, null), 3, null);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        }
    }

    public final void l9(int i14) {
        k9(new jr2.d(i14, jr2.e.parts, null, null, null, 0, 60), new e0(this));
    }

    @Override // com.linecorp.line.avatar.v2.gesture.AvatarGestureFragment.a
    public void m1(m00.c cVar) {
        em3.q.f(cVar, "category");
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.u6(cVar);
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void m2(String str, String str2, Integer num) {
        em3.q.f("onMainClickPromotionItem() urlScheme:" + str + " name:" + str2 + " order:" + num, "msg");
        if (!sm3.r.u(str)) {
            l0 l0Var = this.f34736k;
            if (l0Var != null) {
                l0Var.v6(r00.g.MAIN, r00.c.PROMOTION_BANNER, str2, num, l0Var.m6());
                V8(str, null);
                return;
            }
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void m3() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            r00.g gVar = r00.g.MAIN;
            r00.c cVar = r00.c.CAPTURE;
            if (l0Var != null) {
                l0.w6(l0Var, gVar, cVar, null, null, l0Var.m6(), 12);
                O8(r00.b.AVATAR_MAIN);
                return;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void m8() {
        dz.a aVar = dz.a.f65738a;
        d.a aVar2 = dz.d.Companion;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            dz.d a14 = aVar2.a(l0Var.k6());
            ql3.w wVar = ql3.w.f133304b;
            dz.a.v(aVar, this, a14, wVar, wVar, null, false, false, false, getString(R.string.avatar_friendlist_title_friends), dz.b.AVATAR_MAIN, 16);
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                r00.g gVar = r00.g.MAIN;
                r00.c cVar = r00.c.FRIENDS_LIST;
                if (l0Var2 != null) {
                    l0.w6(l0Var2, gVar, cVar, null, null, l0Var2.m6(), 12);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:24:0x0050, code lost:
        if (r0 == null) goto L_0x0057;
     */
    /* JADX WARNING: Removed duplicated region for block: B:35:0x0074  */
    /* JADX WARNING: Removed duplicated region for block: B:37:0x008a  */
    public final void m9(dm3.a<Unit> aVar) {
        uy.z zVar;
        l0 l0Var;
        l0 l0Var2 = this.f34736k;
        if (l0Var2 != null) {
            z0.a value = l0Var2.f146830e.getValue();
            if (value != null) {
                if (value.f147090d) {
                    l0 l0Var3 = this.f34736k;
                    if (l0Var3 == null) {
                        em3.q.l("viewModel");
                        throw null;
                    } else if (!em3.q.b(l0Var3.f146838i, "-1")) {
                        if (value instanceof z0.a.d) {
                            z0.a.d dVar = (z0.a.d) value;
                            if (!dVar.f147100e) {
                                Integer num = dVar.f147101f;
                                if (num != null) {
                                    int intValue = num.intValue();
                                    r0 r0Var = this.f34739n;
                                    l0 l0Var4 = this.f34736k;
                                    if (l0Var4 != null) {
                                        zVar = r0Var.e(l0Var4.f146872z, intValue);
                                    } else {
                                        em3.q.l("viewModel");
                                        throw null;
                                    }
                                }
                                r0 r0Var2 = this.f34739n;
                                l0 l0Var5 = this.f34736k;
                                if (l0Var5 != null) {
                                    zVar = r0Var2.b(l0Var5.f146872z, true);
                                    l0Var = this.f34736k;
                                    if (l0Var == null) {
                                        um3.g.d(j2.e.g(l0Var), null, 0, new f0(this, zVar, aVar, value, null), 3, null);
                                        return;
                                    } else {
                                        em3.q.l("viewModel");
                                        throw null;
                                    }
                                } else {
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                            }
                        }
                        zVar = this.f34739n.d();
                        l0Var = this.f34736k;
                        if (l0Var == null) {
                        }
                    } else if (aVar != null) {
                        aVar.invoke();
                    }
                } else if (aVar != null) {
                    aVar.invoke();
                }
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void n0() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            r00.g gVar = r00.g.FOCUS;
            r00.c cVar = r00.c.BACKGROUND;
            if (l0Var != null) {
                Integer valueOf = Integer.valueOf(l0Var.l6());
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    l0.w6(l0Var, gVar, cVar, null, valueOf, l0Var2.m6(), 4);
                    b9();
                    return;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void n1() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.S6(true);
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                r00.g gVar = r00.g.MAIN;
                r00.c cVar = r00.c.STICKER;
                if (l0Var2 != null) {
                    l0.w6(l0Var2, gVar, cVar, null, null, l0Var2.m6(), 12);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.background.AvatarBackgroundFragment.a
    public void n2() {
        Z8();
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void n5() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            z0.a value = l0Var.f146830e.getValue();
            z0.a.c cVar = value instanceof z0.a.c ? (z0.a.c) value : null;
            if (cVar != null) {
                cVar.f147098e = null;
                return;
            }
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    public final void n9(String str) {
        zy.b bVar = this.f34735j;
        if (bVar != null) {
            View view = bVar.f201660c;
            if (str == null) {
                str = "";
            }
            view.setBackgroundColor(cz.o.b(str));
            return;
        }
        em3.q.l("binding");
        throw null;
    }

    public final void o9(int i14) {
        g0 g0Var = new g0(this);
        try {
            vd3.a b14 = vd3.f.b(this, i14, new rz.e(g0Var, 0));
            b14.setCanceledOnTouchOutside(false);
            b14.setOnCancelListener(new rz.a(g0Var, 0));
            b14.show();
        } catch (Exception unused) {
        }
    }

    @Override // androidx.activity.ComponentActivity, androidx.fragment.app.n
    public void onActivityResult(int i14, int i15, Intent intent) {
        boolean z14;
        if (i14 == 20001) {
            l0 l0Var = this.f34736k;
            if (l0Var != null) {
                z0 h64 = l0Var.h6();
                if (h64 instanceof z0.a.e) {
                    z14 = true;
                } else {
                    z14 = h64 instanceof z0.a.b;
                }
                if (z14) {
                    l0Var.f146833f0 = true;
                }
                if (i15 == -1 && intent != null) {
                    List<ChosenChat> I2 = K8().I(intent);
                    em3.q.f("[onResultAvatarShare] chat list -> " + I2, "msg");
                    if (!I2.isEmpty()) {
                        t9(false);
                        l0 l0Var2 = this.f34736k;
                        if (l0Var2 != null) {
                            um3.g.d(j2.e.g(l0Var2), null, 0, new sz.v(this, I2, null), 3, null);
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    } else {
                        p9();
                    }
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else if (i14 != 20002) {
            super.onActivityResult(i14, i15, intent);
        }
    }

    @Override // androidx.activity.ComponentActivity
    public void onBackPressed() {
        AvatarBaseFragmentV2 M8 = M8();
        StringBuilder a14 = b.d.a("onBackPressed() fragment:");
        a14.append(M8 != null);
        em3.q.f(a14.toString(), "msg");
        if (M8 == null || !M8.onBackPressed()) {
            super.onBackPressed();
        }
    }

    @Subscribe(SubscriberType.MAIN)
    public final void onChangedLatestUpdateTime(az.a aVar) {
        em3.q.f(aVar, "event");
        em3.q.f("onChangedLatestUpdateTime() event:" + aVar + ' ', "msg");
        s0 s0Var = this.f34737l;
        if (s0Var != null) {
            s0Var.f146959b.L(aVar.f10439a);
            l0 l0Var = this.f34736k;
            if (l0Var != null) {
                l0Var.W6(true);
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    l0Var2.f146834g = false;
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("avatarManager");
            throw null;
        }
    }

    @Override // androidx.appcompat.app.g, androidx.fragment.app.n
    public void onConfigurationChanged(Configuration configuration) {
        em3.q.f(configuration, "newConfig");
        super.onConfigurationChanged(configuration);
        s1 s1Var = this.f34749x;
        if (s1Var != null) {
            if (s1Var != null) {
                s1Var.c(null);
            }
            rz.i.d(rz.i.f140915a, this, R.string.avatar_error_toast_cropviewerfail, 0, 0, 0, 0, false, 124);
        }
    }

    @Override // androidx.activity.ComponentActivity, a2.f, uy.d, androidx.fragment.app.n
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        StringBuilder a14 = b.d.a("onCreate() savedInstanceState:");
        a14.append(bundle != null ? rz.l.c(bundle) : null);
        em3.q.f(a14.toString(), "msg");
        View inflate = getLayoutInflater().inflate(R.layout.activity_avatar, (ViewGroup) null, false);
        int i14 = R.id.avatar_container;
        FrameLayout frameLayout = (FrameLayout) dz.a.g(inflate, R.id.avatar_container);
        if (frameLayout != null) {
            ViewStub viewStub = (ViewStub) dz.a.g(inflate, R.id.avatar_debug_view);
            if (viewStub != null) {
                i14 = R.id.avatar_render_view;
                RenderTextureView renderTextureView = (RenderTextureView) dz.a.g(inflate, R.id.avatar_render_view);
                if (renderTextureView != null) {
                    i14 = R.id.avatar_render_view_placeholder;
                    View g14 = dz.a.g(inflate, R.id.avatar_render_view_placeholder);
                    if (g14 != null) {
                        RelativeLayout relativeLayout = (RelativeLayout) inflate;
                        this.f34735j = new zy.b(relativeLayout, frameLayout, viewStub, renderTextureView, g14);
                        setContentView(relativeLayout);
                        Window window = getWindow();
                        em3.q.e(window, "window");
                        Object obj = b2.b.f10850a;
                        bw2.d.c(window, b.d.a(this, R.color.avatar_status_bar_color), false, 4);
                        AvatarIntentHelper$IntentParams avatarIntentHelper$IntentParams = bundle != null ? (AvatarIntentHelper$IntentParams) bundle.getParcelable("avatar.param") : null;
                        if (avatarIntentHelper$IntentParams == null) {
                            avatarIntentHelper$IntentParams = L8(null).a();
                        }
                        l0 l0Var = (l0) new e1(this, new q0(K8())).b(l0.class);
                        this.f34736k = l0Var;
                        if (l0Var != null) {
                            l0Var.f146826c = avatarIntentHelper$IntentParams;
                            ((w92.c) rb.a.d(this, w92.c.f176479a)).c(this);
                            zy.b bVar = this.f34735j;
                            if (bVar != null) {
                                RenderTextureView renderTextureView2 = (RenderTextureView) bVar.f201664g;
                                em3.q.e(renderTextureView2, "avatarRenderView");
                                rz.l.g(renderTextureView2);
                                ((RenderTextureView) bVar.f201664g).setSurfaceTextureListener(new sz.o(this));
                                ((RenderTextureView) bVar.f201664g).setOnTouchListener(new sz.b(this, 0));
                                float f14 = ((float) rz.l.e(this).x) * 0.5f;
                                zy.b bVar2 = this.f34735j;
                                if (bVar2 != null) {
                                    ((RenderTextureView) bVar2.f201664g).setPivotX(f14);
                                    zy.b bVar3 = this.f34735j;
                                    if (bVar3 != null) {
                                        ((RenderTextureView) bVar3.f201664g).setPivotY(0.0f);
                                        l0 l0Var2 = this.f34736k;
                                        if (l0Var2 != null) {
                                            l0Var2.f146830e.observe(this, new fx.o(this, 3));
                                            l0 l0Var3 = this.f34736k;
                                            if (l0Var3 != null) {
                                                l0Var3.f146839i0.observe(this, new fx.m(this, 2));
                                                l0 l0Var4 = this.f34736k;
                                                if (l0Var4 != null) {
                                                    com.android.billingclient.api.z.j(l0Var4.f146835g0, this, new fx.b(this, 3));
                                                    l0 l0Var5 = this.f34736k;
                                                    if (l0Var5 != null) {
                                                        com.android.billingclient.api.z.j(l0Var5.f146845l0, this, new qk.r(this, 3));
                                                        l0 l0Var6 = this.f34736k;
                                                        if (l0Var6 != null) {
                                                            l0Var6.f146853p0.observe(this, new qk.w(this, 3));
                                                            l0 l0Var7 = this.f34736k;
                                                            if (l0Var7 != null) {
                                                                com.android.billingclient.api.z.k(this, l0Var7.f146869x0, null, new sz.q(this), 2);
                                                                l0 l0Var8 = this.f34736k;
                                                                if (l0Var8 != null) {
                                                                    com.android.billingclient.api.z.k(this, l0Var8.f146871y0, null, new sz.r(this), 2);
                                                                    l0 l0Var9 = this.f34736k;
                                                                    if (l0Var9 != null) {
                                                                        l0Var9.f146856r.observe(this, new bp.a(this, 2));
                                                                        l0 l0Var10 = this.f34736k;
                                                                        if (l0Var10 != null) {
                                                                            l0Var10.A0.observe(this, new qk.x(this, 2));
                                                                            if (this.f34736k != null) {
                                                                                bz.c cVar = (bz.c) rb.a.d(this, bz.c.f15891e0);
                                                                                jr2.p pVar = new jr2.p();
                                                                                p.a aVar = pVar.f98812n;
                                                                                aVar.f98827a = com.linecorp.yuki.content.android.a.AVATAR;
                                                                                aVar.f98828b = cVar.T();
                                                                                aVar.f98817h = "promotion_pop_up";
                                                                                aVar.f98819j = "default_avatar_list";
                                                                                String a15 = pd3.d.c().a();
                                                                                if (a15 == null) {
                                                                                    a15 = "";
                                                                                }
                                                                                aVar.f98829c = a15;
                                                                                aVar.f98821l = "";
                                                                                cVar.l(this, aVar);
                                                                                aVar.f98824o = cVar.G();
                                                                                ProjectParam projectParam = pVar.f98814p;
                                                                                projectParam.setSensetimeLicensePath("SenseME.lic");
                                                                                zr2.f K = cVar.K();
                                                                                projectParam.setInitialEngineType(K.f());
                                                                                projectParam.setAutoChangeEngineType(K.l());
                                                                                l0 l0Var11 = this.f34736k;
                                                                                if (l0Var11 != null) {
                                                                                    s0 s0Var = new s0(this, pVar, j2.e.g(l0Var11));
                                                                                    this.f34737l = s0Var;
                                                                                    zy.b bVar4 = this.f34735j;
                                                                                    if (bVar4 != null) {
                                                                                        RenderTextureView renderTextureView3 = (RenderTextureView) bVar4.f201664g;
                                                                                        em3.q.e(renderTextureView3, "binding.avatarRenderView");
                                                                                        YukiDebugService.a(null, s0Var.i().m());
                                                                                        s0Var.f146959b.f(renderTextureView3);
                                                                                        s0Var.f146959b.s0(new s0.c());
                                                                                        s0Var.f146967j = a1.f.a(null, 1, null);
                                                                                        s0 s0Var2 = this.f34737l;
                                                                                        if (s0Var2 != null) {
                                                                                            s0Var2.f146969l.add(new sz.l(this));
                                                                                            s0 s0Var3 = this.f34737l;
                                                                                            if (s0Var3 != null) {
                                                                                                s0Var3.f146970m = new sz.m(this);
                                                                                                l0 l0Var12 = this.f34736k;
                                                                                                if (l0Var12 != null) {
                                                                                                    l0Var12.F = new sz.n(this);
                                                                                                    if (K8().f(this)) {
                                                                                                        View findViewById = findViewById(R.id.avatar_debug_view);
                                                                                                        em3.q.e(findViewById, "findViewById(R.id.avatar_debug_view)");
                                                                                                        ViewStub viewStub2 = (ViewStub) findViewById;
                                                                                                        s0 s0Var4 = this.f34737l;
                                                                                                        if (s0Var4 != null) {
                                                                                                            new AvatarStatusInfoManagerV2(this, viewStub2, s0Var4);
                                                                                                        } else {
                                                                                                            em3.q.l("avatarManager");
                                                                                                            throw null;
                                                                                                        }
                                                                                                    }
                                                                                                    this.f34738m = new c00.g(this);
                                                                                                    boolean z14 = avatarIntentHelper$IntentParams.f34537c instanceof a.c;
                                                                                                    s0 s0Var5 = this.f34737l;
                                                                                                    if (s0Var5 != null) {
                                                                                                        s0Var5.f146959b.c0(z14);
                                                                                                        s0 s0Var6 = this.f34737l;
                                                                                                        if (s0Var6 != null) {
                                                                                                            gr2.o oVar = s0Var6.f146959b;
                                                                                                            oVar.l("requestPromotionPopupInfo()");
                                                                                                            YukiPackageService yukiPackageService = oVar.f77703n;
                                                                                                            if (yukiPackageService != null) {
                                                                                                                yukiPackageService.requestPackageInfoAsync();
                                                                                                            }
                                                                                                            s1 s1Var = this.f34746u;
                                                                                                            if (s1Var != null) {
                                                                                                                s1Var.c(null);
                                                                                                            }
                                                                                                            l0 l0Var13 = this.f34736k;
                                                                                                            if (l0Var13 != null) {
                                                                                                                this.f34746u = um3.g.d(j2.e.g(l0Var13), null, 0, new r(this, avatarIntentHelper$IntentParams, null), 3, null);
                                                                                                                return;
                                                                                                            } else {
                                                                                                                em3.q.l("viewModel");
                                                                                                                throw null;
                                                                                                            }
                                                                                                        } else {
                                                                                                            em3.q.l("avatarManager");
                                                                                                            throw null;
                                                                                                        }
                                                                                                    } else {
                                                                                                        em3.q.l("avatarManager");
                                                                                                        throw null;
                                                                                                    }
                                                                                                } else {
                                                                                                    em3.q.l("viewModel");
                                                                                                    throw null;
                                                                                                }
                                                                                            } else {
                                                                                                em3.q.l("avatarManager");
                                                                                                throw null;
                                                                                            }
                                                                                        } else {
                                                                                            em3.q.l("avatarManager");
                                                                                            throw null;
                                                                                        }
                                                                                    } else {
                                                                                        em3.q.l("binding");
                                                                                        throw null;
                                                                                    }
                                                                                } else {
                                                                                    em3.q.l("viewModel");
                                                                                    throw null;
                                                                                }
                                                                            } else {
                                                                                em3.q.l("viewModel");
                                                                                throw null;
                                                                            }
                                                                        } else {
                                                                            em3.q.l("viewModel");
                                                                            throw null;
                                                                        }
                                                                    } else {
                                                                        em3.q.l("viewModel");
                                                                        throw null;
                                                                    }
                                                                } else {
                                                                    em3.q.l("viewModel");
                                                                    throw null;
                                                                }
                                                            } else {
                                                                em3.q.l("viewModel");
                                                                throw null;
                                                            }
                                                        } else {
                                                            em3.q.l("viewModel");
                                                            throw null;
                                                        }
                                                    } else {
                                                        em3.q.l("viewModel");
                                                        throw null;
                                                    }
                                                } else {
                                                    em3.q.l("viewModel");
                                                    throw null;
                                                }
                                            } else {
                                                em3.q.l("viewModel");
                                                throw null;
                                            }
                                        } else {
                                            em3.q.l("viewModel");
                                            throw null;
                                        }
                                    } else {
                                        em3.q.l("binding");
                                        throw null;
                                    }
                                } else {
                                    em3.q.l("binding");
                                    throw null;
                                }
                            } else {
                                em3.q.l("binding");
                                throw null;
                            }
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    }
                }
            } else {
                i14 = R.id.avatar_debug_view;
            }
        }
        throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i14)));
    }

    @Override // androidx.appcompat.app.g, uy.d, androidx.fragment.app.n
    public void onDestroy() {
        zy.b bVar = this.f34735j;
        if (bVar != null) {
            ((RenderTextureView) bVar.f201664g).setSurfaceTextureListener(null);
            s0 s0Var = this.f34737l;
            if (s0Var != null) {
                s0Var.q();
                c00.g gVar = this.f34738m;
                if (gVar != null) {
                    gVar.f15975b.a();
                    ((w92.c) rb.a.d(this, w92.c.f176479a)).a(this);
                    super.onDestroy();
                    return;
                }
                em3.q.l("suggestionService");
                throw null;
            }
            em3.q.l("avatarManager");
            throw null;
        }
        em3.q.l("binding");
        throw null;
    }

    @Override // androidx.fragment.app.n
    public void onNewIntent(Intent intent) {
        Bundle extras;
        super.onNewIntent(intent);
        StringBuilder a14 = b.d.a("onNewIntent() intent:");
        a14.append((intent == null || (extras = intent.getExtras()) == null) ? null : rz.l.c(extras));
        em3.q.f(a14.toString(), "msg");
        AvatarIntentHelper$IntentParams a15 = L8(intent).a();
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.f146826c = a15;
            s1 s1Var = this.f34746u;
            if (s1Var != null) {
                s1Var.c(null);
            }
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                this.f34746u = um3.g.d(j2.e.g(l0Var2), null, 0, new x(this, a15, null), 3, null);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // androidx.fragment.app.n
    public void onPause() {
        super.onPause();
        this.f34744s = false;
        s0 s0Var = this.f34737l;
        if (s0Var != null) {
            s0Var.f146959b.R();
        } else {
            em3.q.l("avatarManager");
            throw null;
        }
    }

    @Override // androidx.fragment.app.n
    public void onResume() {
        super.onResume();
        boolean z14 = true;
        this.f34744s = true;
        if (!((bz.c) rb.a.d(this, bz.c.f15891e0)).A(this)) {
            J8();
            return;
        }
        String[] strArr = this.f34729d;
        if (p0.l(this, (String[]) Arrays.copyOf(strArr, strArr.length))) {
            s0 s0Var = this.f34737l;
            if (s0Var != null) {
                s0Var.f146959b.e0();
                AvatarBaseFragmentV2 M8 = M8();
                if (M8 != null) {
                    j9(M8, false);
                }
                l0 l0Var = this.f34736k;
                if (l0Var != null) {
                    z0.a value = l0Var.f146830e.getValue();
                    if (value == null || !value.f147090d) {
                        z14 = false;
                    }
                    if (z14) {
                        l0 l0Var2 = this.f34736k;
                        if (l0Var2 != null) {
                            i9(l0Var2.f146838i);
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("avatarManager");
                throw null;
            }
        } else if (this.f34730e) {
            J8();
        } else {
            this.f34730e = true;
            String[] strArr2 = this.f34729d;
            Intent b14 = PermissionRequestActivity.b(this, (String[]) Arrays.copyOf(strArr2, strArr2.length));
            rz.l.a(b14, this);
            startActivity(b14);
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void p5() {
        T8();
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            r00.g gVar = r00.g.MAIN;
            r00.c cVar = r00.c.SETTING;
            if (l0Var != null) {
                l0.w6(l0Var, gVar, cVar, null, null, l0Var.m6(), 12);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void p7() {
        J8();
    }

    public final void p9() {
        rz.i.d(rz.i.f140915a, this, R.string.avatar_common_toast_temporaryerrroroccurred, 0, 0, 0, 0, false, 124);
    }

    public final void q9() {
        androidx.activity.result.c<Intent> cVar = this.D;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            wy.a aVar = l0Var.U5().f34537c;
            em3.q.f(aVar, "callerType");
            Intent intent = new Intent(this, AvatarIntroductionPageActivity.class);
            intent.putExtras(l2.b.b(TuplesKt.to("avatar.intropage.caller_type", aVar), TuplesKt.to("avatar.intropage.default_tab", null), TuplesKt.to("avatar.intropage.request_metadata", Boolean.FALSE)));
            rz.l.a(intent, this);
            cVar.a(intent, null);
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    public final void r9() {
        h0 h0Var = new h0(this);
        try {
            a.b bVar = new a.b(this);
            bVar.f171186v = false;
            bVar.d(R.string.avatar_editscreen_popupdesc_noavatarfound);
            bVar.f(R.string.avatar_profile_popupbutton_create, new nn.e(h0Var, 1));
            bVar.e(R.string.avatar_profile_popupbutton_later, new dy.b(h0Var, 1));
            bVar.f171187w = new rz.c(h0Var, 0);
            bVar.a().show();
        } catch (Exception unused) {
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void s2() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.D0.setValue(Boolean.FALSE);
            pd3.d.c().s(uf3.a.AVATAR_FOCUS_SET_AS_MAIN_TOOLTIP_SHOWN, Boolean.TRUE);
            return;
        }
        em3.q.l("viewModel");
        throw null;
    }

    public final void s9() {
        boolean z14;
        l0 l0Var = this.f34736k;
        if (l0Var == null) {
            em3.q.l("viewModel");
            throw null;
        } else if (!l0Var.p6()) {
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                Boolean value = l0Var2.f146845l0.getValue();
                Boolean bool = Boolean.TRUE;
                if (!em3.q.b(value, bool)) {
                    s0 s0Var = this.f34737l;
                    if (s0Var != null) {
                        int h14 = s0Var.h();
                        l0 l0Var3 = this.f34736k;
                        if (l0Var3 != null) {
                            z0.a value2 = l0Var3.f146830e.getValue();
                            StringBuilder sb4 = new StringBuilder();
                            sb4.append("[showPopupIfNeeded] visible mode : ");
                            sb4.append(value2);
                            sb4.append(" avatar count : ");
                            sb4.append(h14);
                            sb4.append(" avatar visible mode : ");
                            l0 l0Var4 = this.f34736k;
                            if (l0Var4 != null) {
                                sb4.append(l0Var4.f146830e.getValue());
                                sb4.append(", needToShowPromotion: ");
                                sb4.append(this.f34731f);
                                em3.q.f(sb4.toString(), "msg");
                                if (value2 instanceof z0.a.b) {
                                    String str = ((z0.a.b) value2).f147096i;
                                    s0 s0Var2 = this.f34737l;
                                    if (s0Var2 == null) {
                                        em3.q.l("avatarManager");
                                        throw null;
                                    } else if (s0Var2.h() <= 0 && str == null) {
                                        r9();
                                    }
                                } else {
                                    boolean z15 = false;
                                    boolean z16 = true;
                                    if (value2 instanceof z0.a.d) {
                                        s0 s0Var3 = this.f34737l;
                                        if (s0Var3 == null) {
                                            em3.q.l("avatarManager");
                                            throw null;
                                        } else if (s0Var3.h() <= 0) {
                                            l0 l0Var5 = this.f34736k;
                                            if (l0Var5 != null) {
                                                String str2 = l0Var5.U5().f34538d;
                                                if (str2 == null || sm3.r.u(str2)) {
                                                    z15 = true;
                                                }
                                                if (z15) {
                                                    r9();
                                                    return;
                                                }
                                                return;
                                            }
                                            em3.q.l("viewModel");
                                            throw null;
                                        }
                                    } else if (value2 instanceof z0.a.e) {
                                        P8();
                                        s0 s0Var4 = this.f34737l;
                                        if (s0Var4 == null) {
                                            em3.q.l("avatarManager");
                                            throw null;
                                        } else if (s0Var4.h() > 0 || !this.f34744s) {
                                            l0 l0Var6 = this.f34736k;
                                            if (l0Var6 != null) {
                                                if (l0Var6.f146873z0) {
                                                    z14 = false;
                                                } else {
                                                    Object H2 = pd3.d.c().H(uf3.a.AVATAR_MAIN_GUIDE_SHOWN, Boolean.FALSE);
                                                    Boolean bool2 = H2 instanceof Boolean ? (Boolean) H2 : null;
                                                    z14 = bool2 != null ? !bool2.booleanValue() : true;
                                                }
                                                if (z14) {
                                                    if (getSupportFragmentManager().J("AvatarMainGuide") == null) {
                                                        new AvatarMainGuide().show(getSupportFragmentManager(), "AvatarMainGuide");
                                                        l0 l0Var7 = this.f34736k;
                                                        if (l0Var7 != null) {
                                                            l0Var7.f146873z0 = true;
                                                            pd3.d.c().s(uf3.a.AVATAR_MAIN_GUIDE_SHOWN, bool);
                                                            l0 l0Var8 = this.f34736k;
                                                            if (l0Var8 != null) {
                                                                l0.y6(l0Var8, r00.g.MAIN_GUIDE, null, null, null, 14);
                                                            } else {
                                                                em3.q.l("viewModel");
                                                                throw null;
                                                            }
                                                        } else {
                                                            em3.q.l("viewModel");
                                                            throw null;
                                                        }
                                                    }
                                                } else if (this.f34731f) {
                                                    l0 l0Var9 = this.f34736k;
                                                    if (l0Var9 != null) {
                                                        List<com.linecorp.line.avatar.v2.promotion.d> list = l0Var9.f146866w;
                                                        if (list != null && !list.isEmpty()) {
                                                            z16 = false;
                                                        }
                                                        if (z16) {
                                                            e9();
                                                        } else {
                                                            AvatarPromotionFragmentV2 avatarPromotionFragmentV2 = new AvatarPromotionFragmentV2();
                                                            FragmentManager supportFragmentManager = getSupportFragmentManager();
                                                            em3.q.e(supportFragmentManager, "supportFragmentManager");
                                                            avatarPromotionFragmentV2.show(supportFragmentManager, "AvatarPromotionFragmentV2");
                                                        }
                                                        this.f34731f = false;
                                                        return;
                                                    }
                                                    em3.q.l("viewModel");
                                                    throw null;
                                                }
                                            } else {
                                                em3.q.l("viewModel");
                                                throw null;
                                            }
                                        } else {
                                            q9();
                                        }
                                    } else if (value2 instanceof z0.a.c) {
                                        boolean z17 = ((z0.a.c) value2).f147099f;
                                        Q8();
                                        s0 s0Var5 = this.f34737l;
                                        if (s0Var5 == null) {
                                            em3.q.l("avatarManager");
                                            throw null;
                                        } else if (s0Var5.h() <= 0 && this.f34744s) {
                                            q9();
                                        } else if (z17) {
                                            l0 l0Var10 = this.f34736k;
                                            if (l0Var10 == null) {
                                                em3.q.l("viewModel");
                                                throw null;
                                            } else if (!l0Var10.r6()) {
                                            } else {
                                                if (this.f34736k == null) {
                                                    em3.q.l("viewModel");
                                                    throw null;
                                                } else if (((bz.c) rb.a.d(this, bz.c.f15891e0)).g(this)) {
                                                    l0 l0Var11 = this.f34736k;
                                                    if (l0Var11 != null) {
                                                        l0Var11.J6(true);
                                                    } else {
                                                        em3.q.l("viewModel");
                                                        throw null;
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            } else {
                                em3.q.l("viewModel");
                                throw null;
                            }
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    } else {
                        em3.q.l("avatarManager");
                        throw null;
                    }
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        }
    }

    public final void t9(boolean z14) {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.f146837h0 = z14;
            if (l0Var != null) {
                l0Var.c7(Boolean.TRUE);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void u3(a00.d dVar, boolean z14) {
        em3.q.f(dVar, "tabInfo");
        int id4 = dVar.f65c.getId();
        List<String> list = dVar.f67e;
        String str = dVar.f66d.f57f;
        s0 s0Var = this.f34737l;
        z0.a.b bVar = null;
        if (s0Var != null) {
            s0Var.v(id4, list);
            s0 s0Var2 = this.f34737l;
            if (s0Var2 != null) {
                s0Var2.C(str);
                n9(str);
                boolean z15 = false;
                if (dVar.a()) {
                    l0 l0Var = this.f34736k;
                    if (l0Var != null) {
                        long j14 = dVar.f69g;
                        boolean z16 = dVar.f63a;
                        int i14 = dVar.f64b;
                        YukiStickerCategory yukiStickerCategory = dVar.f65c;
                        a00.a aVar = dVar.f66d;
                        List<String> list2 = dVar.f67e;
                        boolean z17 = dVar.f68f;
                        em3.q.f(yukiStickerCategory, "category");
                        em3.q.f(aVar, "extension");
                        a00.d dVar2 = new a00.d(z16, i14, yukiStickerCategory, aVar, list2, z17, j14, j14);
                        int indexOf = l0Var.D.indexOf(dVar);
                        List<a00.d> M0 = ql3.u.M0(l0Var.D);
                        ArrayList arrayList = (ArrayList) M0;
                        arrayList.remove(indexOf);
                        arrayList.add(indexOf, dVar2);
                        l0Var.D = M0;
                        getApplicationContext().getSharedPreferences("avatar_contents_info", 0).edit().putLong(String.valueOf(dVar.f65c.getId()), j14).apply();
                        l0Var.H.setValue(dVar2);
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    l0 l0Var2 = this.f34736k;
                    if (l0Var2 == null) {
                        em3.q.l("viewModel");
                        throw null;
                    } else if (!em3.q.b(dVar, l0Var2.H.getValue())) {
                        l0Var2.H.setValue(dVar);
                    }
                }
                l0 l0Var3 = this.f34736k;
                if (l0Var3 != null) {
                    z0.a value = l0Var3.f146830e.getValue();
                    if (value instanceof z0.a.b) {
                        bVar = (z0.a.b) value;
                    }
                    if (z14) {
                        if (bVar != null && bVar.f147097j) {
                            z15 = true;
                        }
                        if (z15) {
                            H8();
                            return;
                        }
                    }
                    G8();
                    return;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("avatarManager");
            throw null;
        }
        em3.q.l("avatarManager");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void u4() {
        int x14 = K8().x();
        s0 s0Var = this.f34737l;
        if (s0Var == null) {
            em3.q.l("avatarManager");
            throw null;
        } else if (s0Var.h() >= x14) {
            String string = getString(R.string.avatar_createpopup_desc_limit);
            em3.q.e(string, "getString(R.string.avatar_createpopup_desc_limit)");
            String b14 = j2.c.b(new Object[]{Integer.valueOf(x14)}, 1, string, "format(this, *args)");
            sz.g0 g0Var = new sz.g0(this);
            try {
                a.b bVar = new a.b(this);
                bVar.f171186v = false;
                bVar.f171168d = b14;
                bVar.f(R.string.avatar_createpopup_button_managelist, new rz.f(g0Var, 0));
                bVar.e(R.string.avatar_general_button_cancel, new rz.g(g0Var, 0));
                bVar.f171187w = new rz.d(g0Var);
                bVar.a().show();
            } catch (Exception unused) {
            }
        } else {
            l0 l0Var = this.f34736k;
            if (l0Var != null) {
                l0Var.z6(false);
                pd3.d.c().s(uf3.a.AVATAR_FOCUS_ADD_AVATAR_TOOLTIP_SHOWN, Boolean.TRUE);
                q9();
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    l0.w6(l0Var2, r00.g.FOCUS, r00.c.CREATE, null, null, null, 28);
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        }
    }

    public final void u9(uz.s sVar) {
        a00.a aVar;
        l0 l0Var = this.f34736k;
        List<String> list = null;
        if (l0Var != null) {
            uz.s value = l0Var.Q.getValue();
            l0 l0Var2 = this.f34736k;
            if (l0Var2 != null) {
                l0Var2.H6(sVar);
                if (sVar instanceof s.b) {
                    g.d dVar = ((s.b) sVar).f168820a;
                    if (dVar != null) {
                        s0 s0Var = this.f34737l;
                        if (s0Var != null) {
                            s0Var.g(dVar.f88e.f56e, true);
                        } else {
                            em3.q.l("avatarManager");
                            throw null;
                        }
                    }
                    s0 s0Var2 = this.f34737l;
                    if (s0Var2 != null) {
                        s0Var2.z(uz.t.MORE.d(), true);
                    } else {
                        em3.q.l("avatarManager");
                        throw null;
                    }
                } else if (sVar instanceof s.a) {
                    g.a aVar2 = ((s.a) sVar).f168819a;
                    if (aVar2 != null) {
                        l0 l0Var3 = this.f34736k;
                        if (l0Var3 != null) {
                            Map<String, List<jr2.j>> value2 = l0Var3.K.getValue();
                            if (value2 != null) {
                                l0Var3.L.clear();
                                List<String> list2 = aVar2.f80e.f54c;
                                if (list2 != null) {
                                    for (T t14 : list2) {
                                        List<jr2.j> list3 = value2.get(t14);
                                        if (list3 != null) {
                                            l0Var3.L.put(t14, list3);
                                        }
                                    }
                                }
                                l0Var3.P.setValue(aVar2);
                                return;
                            }
                            return;
                        }
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else if (sVar instanceof s.c) {
                    if (value instanceof s.b) {
                        s0 s0Var3 = this.f34737l;
                        if (s0Var3 != null) {
                            g.d dVar2 = ((s.b) value).f168820a;
                            if (!(dVar2 == null || (aVar = dVar2.f88e) == null)) {
                                list = aVar.f56e;
                            }
                            s0Var3.g(list, false);
                        } else {
                            em3.q.l("avatarManager");
                            throw null;
                        }
                    }
                    G8();
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.view.AvatarNonTransparentProgressFragment.a
    public void v3() {
        s1 s1Var = this.f34749x;
        if (s1Var != null) {
            s1Var.c(null);
        }
        this.f34749x = null;
    }

    public final void v9(String str) {
        if (str == null) {
            s1 s1Var = this.f34751z;
            if (s1Var != null) {
                s1Var.c(null);
            }
            l0 l0Var = this.f34736k;
            if (l0Var != null) {
                com.android.billingclient.api.z.m(l0Var.f146862u, null);
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    com.android.billingclient.api.z.m(l0Var2.f146860t, null);
                    l0 l0Var3 = this.f34736k;
                    if (l0Var3 != null) {
                        l0Var3.b7(false);
                        l0 l0Var4 = this.f34736k;
                        if (l0Var4 != null) {
                            l0Var4.Z6(false);
                        } else {
                            em3.q.l("viewModel");
                            throw null;
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            l0 l0Var5 = this.f34736k;
            if (l0Var5 != null) {
                this.f34751z = um3.g.d(j2.e.g(l0Var5), null, 0, new sz.f0(this, str, null), 3, null);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void w0() {
        b9();
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            r00.g gVar = r00.g.MAIN;
            r00.c cVar = r00.c.BACKGROUND;
            if (l0Var != null) {
                l0.w6(l0Var, gVar, cVar, null, null, l0Var.m6(), 12);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void w1() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            r00.g gVar = r00.g.FOCUS;
            r00.c cVar = r00.c.GESTURE;
            if (l0Var != null) {
                Integer valueOf = Integer.valueOf(l0Var.l6());
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    l0.w6(l0Var, gVar, cVar, null, valueOf, l0Var2.m6(), 4);
                    c9();
                    return;
                }
                em3.q.l("viewModel");
                throw null;
            }
            em3.q.l("viewModel");
            throw null;
        }
        em3.q.l("viewModel");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.main.AvatarMainFragmentV2.a
    public void w6() {
        X8(new z0.a.c(null, true, 1), false);
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            r00.g gVar = r00.g.MAIN;
            r00.c cVar = r00.c.PREVIEW_FOCUSED;
            if (l0Var != null) {
                l0.w6(l0Var, gVar, cVar, null, null, l0Var.m6(), 12);
            } else {
                em3.q.l("viewModel");
                throw null;
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.d
    public int w7(String str, float f14) {
        er2.g gVar;
        YukiEffectService yukiEffectService;
        em3.q.f(str, "colorText");
        s0 s0Var = this.f34737l;
        if (s0Var != null) {
            Objects.requireNonNull(s0Var);
            cz.o a14 = cz.o.a(str);
            gr2.o oVar = s0Var.f146959b;
            int i14 = a14.f61985a;
            int i15 = a14.f61986b;
            int i16 = a14.f61987c;
            boolean J2 = oVar.J("getAvatarSliderColor");
            StringBuilder a15 = a3.j.a("getAvatarSliderColor() rgb:(", i14, ", ", i15, ", ");
            a15.append(i16);
            a15.append(") factor:");
            a15.append(f14);
            a15.append(" scriptReady:");
            sz.g.a(a15, !J2, oVar);
            if (J2 || (gVar = oVar.f77697k) == null || (yukiEffectService = gVar.f69145a) == null) {
                return 0;
            }
            return yukiEffectService.getAvatarSliderColor(i14, i15, i16, f14);
        }
        em3.q.l("avatarManager");
        throw null;
    }

    @Override // com.linecorp.line.avatar.v2.main.focusview.AvatarFocusViewFragment.b
    public void x0() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            l0Var.z6(false);
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void x1(String str, float f14) {
        em3.q.f("[onCustomizationControlPointSeekBarProgressChanged] key: " + str + ", progress: " + f14, "msg");
        s0 s0Var = this.f34737l;
        if (s0Var != null) {
            s0Var.x(str, f14, false);
        } else {
            em3.q.l("avatarManager");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void x4() {
        jr2.f fVar;
        g.d dVar;
        List<jr2.h> a14;
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            jr2.f value = l0Var.O.getValue();
            if (value != null) {
                for (T t14 : value.a()) {
                    s0 s0Var = this.f34737l;
                    if (s0Var != null) {
                        s0Var.x(t14.f(), t14.d(), true);
                    } else {
                        em3.q.l("avatarManager");
                        throw null;
                    }
                }
                l0 l0Var2 = this.f34736k;
                if (l0Var2 != null) {
                    o0<jr2.f> o0Var = l0Var2.O;
                    jr2.f value2 = o0Var.getValue();
                    if (value2 == null || (a14 = value2.a()) == null) {
                        fVar = null;
                    } else {
                        ArrayList arrayList = new ArrayList(ql3.q.p(a14, 10));
                        for (T t15 : a14) {
                            arrayList.add(jr2.h.a(t15, 0.0f, 0.0f, 0.0f, null, 0, t15.d(), 31));
                        }
                        fVar = new jr2.f(arrayList);
                    }
                    o0Var.setValue(fVar);
                    l0Var2.N = true;
                    l0 l0Var3 = this.f34736k;
                    if (l0Var3 != null) {
                        uz.s value3 = l0Var3.Q.getValue();
                        if ((value3 instanceof s.b) && (dVar = ((s.b) value3).f168820a) != null) {
                            l0 l0Var4 = this.f34736k;
                            if (l0Var4 != null) {
                                r00.g gVar = r00.g.CUSTOMIZATION;
                                r00.c cVar = r00.c.CONTROL_POINT_RESET;
                                r00.d N8 = N8(dVar);
                                l0 l0Var5 = this.f34736k;
                                if (l0Var5 != null) {
                                    l0Var4.x6(gVar, cVar, N8, l0Var5.m6());
                                } else {
                                    em3.q.l("viewModel");
                                    throw null;
                                }
                            } else {
                                em3.q.l("viewModel");
                                throw null;
                            }
                        }
                    } else {
                        em3.q.l("viewModel");
                        throw null;
                    }
                } else {
                    em3.q.l("viewModel");
                    throw null;
                }
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.customization.AvatarCustomizationFragmentV2.b
    public void x7() {
        l0 l0Var = this.f34736k;
        if (l0Var != null) {
            int i14 = em3.q.b(l0Var.B.getValue(), Boolean.TRUE) ? R.string.avatar_itempopup_desc_onlyhuman : R.string.avatar_itempopup_desc_onlyanimal;
            s sVar = new s(this);
            try {
                a.b bVar = new a.b(this);
                bVar.f171186v = false;
                bVar.d(i14);
                bVar.f(R.string.avatar_itempopup_button_change, new nn.e(sVar, 1));
                bVar.e(R.string.avatar_itempopup_button_cancel, new dy.b(sVar, 1));
                bVar.f171187w = new rz.c(sVar, 0);
                bVar.a().show();
            } catch (Exception unused) {
            }
        } else {
            em3.q.l("viewModel");
            throw null;
        }
    }

    @Override // com.linecorp.line.avatar.v2.loading.AvatarShortLoadFragmentV2.a
    public void y7() {
        S8(500, new z(this));
    }
}