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


package qh1;

import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ScrollView;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import com.linecorp.square.chat.SquareChatUtils;
import dm3.l;
import em3.q;
import jp.naver.line.android.R;
import kotlin.ResultKt;
import kotlin.Unit;
import mt.r;
import ul3.d;
import um3.r0;
import vi1.m;
import wl3.c;
import wl3.e;
import xi1.b;
import yo1.i;
import yo1.k;
import zo1.s0;

public final class n {

    /* renamed from: a  reason: collision with root package name */
    public static final n f132566a = new n();

    @e(c = "com.linecorp.line.story.impl.common.util.StoryUtils", f = "StoryUtils.kt", l = {271, 275}, m = "waitAtLeast")
    public static final class a<T> extends c {

        /* renamed from: b  reason: collision with root package name */
        public long f132567b;

        /* renamed from: c  reason: collision with root package name */
        public long f132568c;

        /* renamed from: d  reason: collision with root package name */
        public Object f132569d;

        /* renamed from: e  reason: collision with root package name */
        public /* synthetic */ Object f132570e;

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

        /* renamed from: g  reason: collision with root package name */
        public int f132572g;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public a(n nVar, d<? super a> dVar) {
            super(dVar);
            this.f132571f = nVar;
        }

        @Override // wl3.a
        public final Object invokeSuspend(Object obj) {
            this.f132570e = obj;
            this.f132572g |= Integer.MIN_VALUE;
            return this.f132571f.h(0, null, this);
        }
    }

    public static String c(n nVar, Context context, ik0.a aVar, String str, boolean z14, int i14) {
        boolean z15 = true;
        if ((i14 & 8) != 0) {
            z14 = true;
        }
        q.f(context, "context");
        q.f(aVar, "myProfile");
        if (str == null || str.length() == 0) {
            return null;
        }
        if (((ch1.c) rb.a.d(context, ch1.c.f18007f0)).d(str)) {
            return "unknown";
        }
        if (q.b(str, aVar.f88072b)) {
            return aVar.f88078h;
        }
        if (SquareChatUtils.c(str) || SquareChatUtils.b(str)) {
            return pd3.d.c().d(str, true);
        }
        m a14 = nVar.a(context, str);
        if (a14 == null || !a14.f172396e) {
            z15 = false;
        }
        if (z15) {
            return a14.f172393b;
        }
        if (z14 || a14 == null) {
            return null;
        }
        return a14.f172393b;
    }

    public final m a(Context context, String str) {
        q.f(str, zq0.c.QUERY_KEY_MID);
        return ((ch1.c) rb.a.d(context, ch1.c.f18007f0)).c(str);
    }

    /* JADX WARNING: Removed duplicated region for block: B:14:0x0033  */
    /* JADX WARNING: Removed duplicated region for block: B:18:0x004c  */
    public final String b(Context context, s0 s0Var) {
        boolean z14;
        q.f(context, "context");
        if (s0Var == null) {
            return null;
        }
        String f14 = ((i) rb.a.d(context, i.f195478c)).f(k.STORY_PHOTO);
        String b14 = s0Var.b();
        if (b14 != null) {
            if (b14.length() > 0) {
                z14 = true;
                String str = "";
                if (!z14) {
                    CharSequence[] charSequenceArr = new CharSequence[3];
                    charSequenceArr[0] = d();
                    String b15 = s0Var.b();
                    if (b15 != null) {
                        str = b15;
                    }
                    charSequenceArr[1] = str;
                    charSequenceArr[2] = f14;
                    return b2.a.v(charSequenceArr);
                }
                CharSequence[] charSequenceArr2 = new CharSequence[6];
                charSequenceArr2[0] = d();
                charSequenceArr2[1] = "r";
                String str2 = s0Var.f200171d;
                if (str2 == null) {
                    str2 = str;
                }
                charSequenceArr2[2] = str2;
                String str3 = s0Var.f200172e;
                if (str3 == null) {
                    str3 = str;
                }
                charSequenceArr2[3] = str3;
                String str4 = s0Var.f200170c;
                if (str4 != null) {
                    str = str4;
                }
                charSequenceArr2[4] = str;
                charSequenceArr2[5] = f14;
                return b2.a.v(charSequenceArr2);
            }
        }
        z14 = false;
        String str5 = "";
        if (!z14) {
        }
    }

    public final String d() {
        String e14 = nj1.a.b().e();
        q.e(e14, "getInstance().obsCdnServerHost");
        return e14;
    }

    public final void e(ImageView imageView, s0 s0Var, b bVar, xi1.a aVar) {
        q.f(imageView, "imageView");
        q.f(s0Var, "media");
        Context context = imageView.getContext();
        q.e(context, "imageView.context");
        String b14 = b(context, s0Var);
        if (b14 != null) {
            Context context2 = imageView.getContext();
            q.e(context2, "imageView.context");
            ((ch1.c) rb.a.d(context2, ch1.c.f18007f0)).n().e(imageView, b14, bVar, aVar);
        }
    }

    public final void f(Context context, String str, boolean z14, dm3.a<Unit> aVar) {
        q.f(context, "context");
        q.f(str, "displayName");
        Dialog dialog = new Dialog(context, R.style.StoryConfirmPopup);
        View inflate = LayoutInflater.from(context).inflate(R.layout.story_timeline_block_confirm_popup2, (ViewGroup) null, false);
        int i14 = R.id.confirm_popup_confirm_button;
        TextView textView = (TextView) dz.a.g(inflate, R.id.confirm_popup_confirm_button);
        if (textView != null) {
            i14 = R.id.confirm_popup_description;
            if (((ScrollView) dz.a.g(inflate, R.id.confirm_popup_description)) != null) {
                i14 = R.id.confirm_popup_description_text;
                TextView textView2 = (TextView) dz.a.g(inflate, R.id.confirm_popup_description_text);
                if (textView2 != null) {
                    i14 = R.id.confirm_popup_title;
                    TextView textView3 = (TextView) dz.a.g(inflate, R.id.confirm_popup_title);
                    if (textView3 != null) {
                        dialog.setContentView((ConstraintLayout) inflate);
                        if (z14) {
                            textView3.setText(context.getString(R.string.timeline_unblock_popuptitle_unblockedontimeline, str));
                            textView2.setText(R.string.timeline_unblock_popupdesc_unblockedontimeline);
                        } else {
                            textView3.setText(context.getString(R.string.timeline_block_popuptitle_blockedontimeline, str));
                            textView2.setText(R.string.timeline_block_popupdesc_blockedontimeline);
                        }
                        textView.setOnClickListener(new l(aVar, dialog, 0));
                        dialog.show();
                        return;
                    }
                }
            }
        }
        throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i14)));
    }

    public final void g(Context context, String str, boolean z14, dm3.a<Unit> aVar) {
        String str2 = context.getString(R.string.timeline_unblock_popupdesc_changesettingsone) + "\n\n" + context.getString(R.string.timeline_unblock_popupdesc_changesettingstwo) + '\n' + context.getString(R.string.timeline_unblock_popupdesc_changesettingsthree);
        String str3 = context.getString(R.string.timeline_block_popupdesc_changesettingsone) + "\n\n" + context.getString(R.string.timeline_block_popupdesc_changesettingstwo) + '\n' + context.getString(R.string.timeline_block_popupdesc_changesettingsthree) + '\n' + context.getString(R.string.timeline_block_popupdesc_changesettingsfour);
        Dialog dialog = new Dialog(context, R.style.StoryConfirmPopup);
        View inflate = LayoutInflater.from(context).inflate(R.layout.story_timeline_block_confirm_popup, (ViewGroup) null, false);
        int i14 = R.id.confirm_popup_action_button;
        TextView textView = (TextView) dz.a.g(inflate, R.id.confirm_popup_action_button);
        if (textView != null) {
            i14 = R.id.confirm_popup_cancel;
            TextView textView2 = (TextView) dz.a.g(inflate, R.id.confirm_popup_cancel);
            if (textView2 != null) {
                i14 = R.id.confirm_popup_description;
                if (((ScrollView) dz.a.g(inflate, R.id.confirm_popup_description)) != null) {
                    i14 = R.id.confirm_popup_description_text;
                    TextView textView3 = (TextView) dz.a.g(inflate, R.id.confirm_popup_description_text);
                    if (textView3 != null) {
                        i14 = R.id.confirm_popup_link;
                        TextView textView4 = (TextView) dz.a.g(inflate, R.id.confirm_popup_link);
                        if (textView4 != null) {
                            i14 = R.id.confirm_popup_title;
                            TextView textView5 = (TextView) dz.a.g(inflate, R.id.confirm_popup_title);
                            if (textView5 != null) {
                                dialog.setContentView((ConstraintLayout) inflate);
                                if (z14) {
                                    textView5.setText(context.getString(R.string.timeline_unblock_popuptitle_unblockontimeline, str));
                                    textView3.setText(str2);
                                    textView.setText(context.getString(R.string.timeline_unblock_popupbutton_unblock));
                                } else {
                                    textView5.setText(context.getString(R.string.timeline_block_popuptitle_blockontimeline, str));
                                    textView3.setText(str3);
                                    textView.setText(context.getString(R.string.timeline_block_popupbutton_block));
                                }
                                textView.setOnClickListener(new vz.k(aVar, dialog, 6));
                                textView2.setOnClickListener(new r(dialog, 11));
                                textView4.setOnClickListener(new pk.a("https://help.line.me/line/android/categoryId/20007858/2/", 11));
                                dialog.show();
                                return;
                            }
                        }
                    }
                }
            }
        }
        throw new NullPointerException("Missing required view with ID: ".concat(inflate.getResources().getResourceName(i14)));
    }

    /* JADX WARNING: Removed duplicated region for block: B:14:0x003c  */
    /* JADX WARNING: Removed duplicated region for block: B:20:0x005c  */
    /* JADX WARNING: Removed duplicated region for block: B:26:? A[RETURN, SYNTHETIC] */
    /* JADX WARNING: Removed duplicated region for block: B:8:0x0022  */
    public final <T> Object h(long j14, l<? super d<? super T>, ? extends Object> lVar, d<? super T> dVar) {
        a aVar;
        int i14;
        Object obj;
        long j15;
        long j16;
        long currentTimeMillis;
        if (dVar instanceof a) {
            aVar = (a) dVar;
            int i15 = aVar.f132572g;
            if ((i15 & Integer.MIN_VALUE) != 0) {
                aVar.f132572g = i15 - Integer.MIN_VALUE;
                Object obj2 = aVar.f132570e;
                vl3.a aVar2 = vl3.a.COROUTINE_SUSPENDED;
                i14 = aVar.f132572g;
                if (i14 != 0) {
                    ResultKt.throwOnFailure(obj2);
                    long currentTimeMillis2 = System.currentTimeMillis();
                    aVar.f132567b = j14;
                    aVar.f132568c = currentTimeMillis2;
                    aVar.f132572g = 1;
                    obj2 = lVar.invoke(aVar);
                    if (obj2 == aVar2) {
                        return aVar2;
                    }
                    j15 = currentTimeMillis2;
                    j16 = j14;
                } else if (i14 == 1) {
                    j15 = aVar.f132568c;
                    j16 = aVar.f132567b;
                    ResultKt.throwOnFailure(obj2);
                } else if (i14 == 2) {
                    obj = aVar.f132569d;
                    ResultKt.throwOnFailure(obj2);
                    return obj;
                } else {
                    throw new IllegalStateException("call to 'resume' before 'invoke' with coroutine");
                }
                currentTimeMillis = System.currentTimeMillis() - j15;
                if (currentTimeMillis < j16) {
                    return obj2;
                }
                aVar.f132569d = obj2;
                aVar.f132572g = 2;
                if (r0.b(j16 - currentTimeMillis, aVar) == aVar2) {
                    return aVar2;
                }
                obj = obj2;
                return obj;
            }
        }
        aVar = new a(this, dVar);
        Object obj22 = aVar.f132570e;
        vl3.a aVar22 = vl3.a.COROUTINE_SUSPENDED;
        i14 = aVar.f132572g;
        if (i14 != 0) {
        }
        currentTimeMillis = System.currentTimeMillis() - j15;
        if (currentTimeMillis < j16) {
        }
    }
}