package com.ss.android.ugc.aweme.compliance.business.serviceimpl;

import X.C12422nK;
import X.C68464vW;
import X.Lnj;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.ss.android.ugc.aweme.compliance.api.services.report.IReportService;
import com.ss.android.ugc.aweme.compliance.business.report.ReportWebPageDialogActivity;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.setting.services.SettingServiceImpl;
import java.util.Map;

public class ReportServiceImpl implements IReportService {
    static {
        Covode.recordClassIndex(61155);
    }

    public static IReportService LIZ() {
        MethodCollector.i(2975);
        IReportService iReportService = (IReportService) Lnj.LIZ(IReportService.class, false);
        if (iReportService != null) {
            MethodCollector.o(2975);
            return iReportService;
        }
        Object LIZIZ = Lnj.LIZIZ(IReportService.class, false);
        if (LIZIZ != null) {
            IReportService iReportService2 = (IReportService) LIZIZ;
            MethodCollector.o(2975);
            return iReportService2;
        }
        if (Lnj.LLIIIILZ == null) {
            synchronized (IReportService.class) {
                try {
                    if (Lnj.LLIIIILZ == null) {
                        Lnj.LLIIIILZ = new ReportServiceImpl();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(2975);
                    throw th;
                }
            }
        }
        ReportServiceImpl reportServiceImpl = (ReportServiceImpl) Lnj.LLIIIILZ;
        MethodCollector.o(2975);
        return reportServiceImpl;
    }

    public final String LIZ(String str) {
        if (TextUtils.equals(str, "long_press_mask_layer")) {
            return "long_press";
        }
        return "click_share_button";
    }

    public final String LIZ(Aweme aweme) {
        if (aweme == null) {
            return "";
        }
        if (aweme.isForwardAweme()) {
            return "forward";
        }
        if (aweme.isImage()) {
            return "image";
        }
        return "video";
    }

    public final void LIZ(Map<String, String> map) {
        if (map != null) {
            C12422nK.LIZ("tip_off", map);
        }
    }

    public final void LIZ(Activity activity, Uri.Builder builder) {
        LIZ(activity, builder, (Bundle) null);
    }

    public final void LIZIZ(Activity activity, Uri.Builder builder) {
        if (activity != null) {
            C68464vW.LIZ("https://www.tiktok.com/falcon/communitysafety/page/reasons_ad/index.html", builder);
            Uri build = builder.build();
            Bundle bundle = new Bundle();
            bundle.putString("url", build.toString());
            bundle.putBoolean("show_load_dialog", false);
            bundle.putBoolean("hide_nav_bar", true);
            bundle.putString("status_bar_color", activity.getResources().getString(2131100281).replace("#", ""));
            bundle.putLong("enter_time", System.currentTimeMillis());
            ReportWebPageDialogActivity.LIZJ.LIZ(activity, bundle, build.getQueryParameter("object_id"), build.getQueryParameter("enter_from"));
        }
    }

    public final void LIZ(Activity activity, Aweme aweme) {
        if (activity != null) {
            Uri.Builder appendQueryParameter = new Uri.Builder().appendQueryParameter("object_id", aweme.getAid()).appendQueryParameter("owner_id", aweme.getAuthorUid());
            String str = "video";
            if (aweme.getAwemeType() == 13) {
                str = "forward";
            } else if (aweme.getAwemeType() == 2) {
                str = "image";
            } else if (!(aweme.getAwemeType() == 0 || aweme.getAwemeType() == 51 || aweme.getAwemeType() == 52 || aweme.getAwemeType() == 54 || aweme.getAwemeType() == 53 || aweme.getAwemeType() == 55 || aweme.getAwemeType() == 56 || aweme.getAwemeType() == 34)) {
                if (aweme.getAwemeType() == 150) {
                    str = "photo_mode";
                } else if (aweme.getAwemeRawAd() != null && aweme.getAwemeRawAd().getSystemOrigin() == 1) {
                    str = "douplus";
                } else if (aweme.isAd()) {
                    str = "ad";
                }
            }
            C68464vW.LIZ(activity, appendQueryParameter.appendQueryParameter("report_type", str).appendQueryParameter("locale", SettingServiceImpl.LJIJJ().LJII()), (Bundle) null);
        }
    }

    public final void LIZ(Activity activity, Uri.Builder builder, Bundle bundle) {
        if (activity != null) {
            C68464vW.LIZ(activity, builder, bundle);
        }
    }

    public final void LIZ(String str, String str2, String str3, String str4, String str5, String str6, String str7) {
        String str8 = str;
        C68464vW.LIZ(str8, str2, str3, str4, str5, str6, str7, (Aweme) null, (String) null, (String) null, "", (Context) null);
    }

    public final void LIZ(String str, String str2, String str3, String str4, String str5, String str6, String str7, Aweme aweme, String str8, String str9, String str10, Context context) {
        String str11 = str4;
        String str12 = str3;
        String str13 = str;
        String str14 = str2;
        String str15 = str8;
        Aweme aweme2 = aweme;
        String str16 = str7;
        C68464vW.LIZ(str13, str14, str12, str11, str5, str6, str16, aweme2, str15, str9, str10, context);
    }
}
