package com.ss.android.ugc.aweme.commercialize_tools_api.singleton;

import X.F58;
import X.M12;
import X.TSt;
import android.app.Activity;
import android.graphics.Color;
import com.bytedance.covode.number.Covode;
import java.util.Iterator;
import kotlin.h.b.n;
import org.json.JSONObject;

public final class TroubleshootingLogDelegate {
    public static final TroubleshootingLogDelegate INSTANCE = new TroubleshootingLogDelegate();
    public static F58 mLogVisualPanelImpl;

    private final void getLogVisualPanelImpl() {
    }

    public final void awesomeSplashLog(String str) {
        awesomeSplashLog$default(this, str, (String) null, 0, 6, (Object) null);
    }

    public final void awesomeSplashLog(String str, String str2) {
        awesomeSplashLog$default(this, str, str2, 0, 4, (Object) null);
    }

    public final void ordinarySplashLog(String str) {
        ordinarySplashLog$default(this, str, (String) null, 0, 6, (Object) null);
    }

    public final void ordinarySplashLog(String str, String str2) {
        ordinarySplashLog$default(this, str, str2, 0, 4, (Object) null);
    }

    static {
        Covode.recordClassIndex(60219);
    }

    private final void appLogV1Log(String str) {
        getLogVisualPanelImpl();
        if (mLogVisualPanelImpl != null) {
            Color.parseColor("#BBC1E3");
        }
    }

    private final void appLogV3Log(String str) {
        getLogVisualPanelImpl();
        if (mLogVisualPanelImpl != null) {
            Color.parseColor("#359E7E");
        }
    }

    public static final void showLogVisualPanel(Activity activity) {
        M12.LIZ(activity);
        INSTANCE.getLogVisualPanelImpl();
    }

    public final void handleV3Log(String str, JSONObject jSONObject) {
        try {
            StringBuilder sb = new StringBuilder();
            sb.append("event_name:" + str + 10);
            if (jSONObject != null) {
                Iterator<String> keys = jSONObject.keys();
                n.LIZIZ(keys, "");
                while (keys.hasNext()) {
                    String next = keys.next();
                    sb.append(next + ':' + jSONObject.opt(next) + 10);
                }
            }
            String sb2 = sb.toString();
            n.LIZIZ(sb2, "");
            appLogV3Log(sb2);
        } catch (Exception e) {
            TSt.LIZ(e);
        }
    }

    public final void awesomeSplashLog(String str, String str2, int i) {
        M12.LIZ(str);
        getLogVisualPanelImpl();
        if (mLogVisualPanelImpl != null) {
            Color.parseColor("#B6ACB1");
        }
    }

    public final void ordinarySplashLog(String str, String str2, int i) {
        M12.LIZ(str);
        getLogVisualPanelImpl();
        if (mLogVisualPanelImpl != null) {
            Color.parseColor("#fdcb6e");
        }
    }

    public final void handleV1Log(String str, String str2, Long l, Long l2, JSONObject jSONObject) {
        try {
            StringBuilder sb = new StringBuilder();
            sb.append("tag:" + str + 10);
            sb.append("label:" + str2 + 10);
            sb.append("value:" + l + 10);
            sb.append("ext_value:" + l2 + 10);
            if (jSONObject != null) {
                Iterator<String> keys = jSONObject.keys();
                n.LIZIZ(keys, "");
                while (keys.hasNext()) {
                    String next = keys.next();
                    sb.append(next + ':' + jSONObject.opt(next) + 10);
                }
            }
            String sb2 = sb.toString();
            n.LIZIZ(sb2, "");
            appLogV1Log(sb2);
        } catch (Exception e) {
            TSt.LIZ(e);
        }
    }

    public static /* synthetic */ void awesomeSplashLog$default(TroubleshootingLogDelegate troubleshootingLogDelegate, String str, String str2, int i, int i2, Object obj) {
        if ((i2 & 2) != 0) {
            str2 = null;
        }
        if ((i2 & 4) != 0) {
            i = 3;
        }
        troubleshootingLogDelegate.awesomeSplashLog(str, str2, i);
    }

    public static /* synthetic */ void ordinarySplashLog$default(TroubleshootingLogDelegate troubleshootingLogDelegate, String str, String str2, int i, int i2, Object obj) {
        if ((i2 & 2) != 0) {
            str2 = null;
        }
        if ((i2 & 4) != 0) {
            i = 3;
        }
        troubleshootingLogDelegate.ordinarySplashLog(str, str2, i);
    }
}
