package com.bytedance.sdk.component.adexpress.yz;

import android.net.Uri;
import android.text.TextUtils;
import androidx.media3.common.MimeTypes;

/* JADX INFO: loaded from: classes.dex */
public class ef {

    public enum fm {
        HTML("text/html"),
        CSS("text/css"),
        JS("application/x-javascript"),
        IMAGE("image/*"),
        VIDEO(MimeTypes.VIDEO_MP4);

        private String ajl;

        fm(String str) {
            this.ajl = str;
        }

        public String fm() {
            return this.ajl;
        }
    }

    public static fm fm(String str) {
        fm fmVar = fm.IMAGE;
        if (!TextUtils.isEmpty(str)) {
            try {
                String path = Uri.parse(str).getPath();
                if (path != null) {
                    if (path.endsWith(".css")) {
                        fmVar = fm.CSS;
                    } else if (path.endsWith(".js")) {
                        fmVar = fm.JS;
                    } else if (!path.endsWith(".jpg") && !path.endsWith(".gif") && !path.endsWith(".png") && !path.endsWith(".jpeg") && !path.endsWith(".webp") && !path.endsWith(".bmp") && !path.endsWith(".ico")) {
                        if (path.endsWith(".html")) {
                            fmVar = fm.HTML;
                        } else if (path.endsWith(".mp4")) {
                            fmVar = fm.VIDEO;
                        }
                    }
                }
            } catch (Throwable unused) {
            }
        }
        return fmVar;
    }
}
