package p037.p065.p078;

import android.graphics.Insets;
import android.graphics.Rect;
import android.os.Build;
import android.util.Log;
import android.view.DisplayCutout;
import android.view.WindowInsets;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.util.Objects;
import p037.p065.p070.C1863;

/* JADX INFO: renamed from: މ.ރ.ފ.ޕ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C1937 {

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public static final C1937 f6390;

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public final C1945 f6391;

    /* JADX INFO: renamed from: މ.ރ.ފ.ޕ$֏, reason: contains not printable characters */
    public static class C1938 extends C1940 {

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public static Field f6392;

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public static boolean f6393;

        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public static Constructor<WindowInsets> f6394;

        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public static boolean f6395;

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public WindowInsets f6396;

        /* JADX WARN: Removed duplicated region for block: B:17:0x0037  */
        /*
            Code decompiled incorrectly, please refer to instructions dump.
        */
        public C1938() throws IllegalAccessException, InstantiationException, InvocationTargetException {
            WindowInsets windowInsets;
            if (!f6393) {
                try {
                    f6392 = WindowInsets.class.getDeclaredField("CONSUMED");
                } catch (ReflectiveOperationException e) {
                    Log.i("WindowInsetsCompat", "Could not retrieve WindowInsets.CONSUMED field", e);
                }
                f6393 = true;
            }
            Field field = f6392;
            WindowInsets windowInsets2 = null;
            if (field != null) {
                try {
                    windowInsets = (WindowInsets) field.get(null);
                } catch (ReflectiveOperationException e2) {
                    Log.i("WindowInsetsCompat", "Could not get value from WindowInsets.CONSUMED field", e2);
                }
                if (windowInsets != null) {
                    windowInsets2 = new WindowInsets(windowInsets);
                } else {
                    if (!f6395) {
                        try {
                            f6394 = WindowInsets.class.getConstructor(Rect.class);
                        } catch (ReflectiveOperationException e3) {
                            Log.i("WindowInsetsCompat", "Could not retrieve WindowInsets(Rect) constructor", e3);
                        }
                        f6395 = true;
                    }
                    Constructor<WindowInsets> constructor = f6394;
                    if (constructor != null) {
                        try {
                            windowInsets2 = constructor.newInstance(new Rect());
                        } catch (ReflectiveOperationException e4) {
                            Log.i("WindowInsetsCompat", "Could not invoke WindowInsets(Rect) constructor", e4);
                        }
                    }
                }
            }
            this.f6396 = windowInsets2;
        }

        public C1938(C1937 c1937) {
            this.f6396 = c1937.m3800();
        }

        @Override // p037.p065.p078.C1937.C1940
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public C1937 mo3801() {
            return C1937.m3794(this.f6396);
        }

        @Override // p037.p065.p078.C1937.C1940
        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public void mo3802(C1863 c1863) {
            WindowInsets windowInsets = this.f6396;
            if (windowInsets != null) {
                this.f6396 = windowInsets.replaceSystemWindowInsets(c1863.f6252, c1863.f6253, c1863.f6254, c1863.f6255);
            }
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ފ.ޕ$ؠ, reason: contains not printable characters */
    public static class C1939 extends C1940 {

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final WindowInsets.Builder f6397;

        public C1939() {
            this.f6397 = new WindowInsets.Builder();
        }

        public C1939(C1937 c1937) {
            WindowInsets windowInsetsM3800 = c1937.m3800();
            this.f6397 = windowInsetsM3800 != null ? new WindowInsets.Builder(windowInsetsM3800) : new WindowInsets.Builder();
        }

        @Override // p037.p065.p078.C1937.C1940
        /* JADX INFO: renamed from: ֏ */
        public C1937 mo3801() {
            return C1937.m3794(this.f6397.build());
        }

        @Override // p037.p065.p078.C1937.C1940
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public void mo3803(C1863 c1863) {
            this.f6397.setStableInsets(Insets.of(c1863.f6252, c1863.f6253, c1863.f6254, c1863.f6255));
        }

        @Override // p037.p065.p078.C1937.C1940
        /* JADX INFO: renamed from: ؠ */
        public void mo3802(C1863 c1863) {
            this.f6397.setSystemWindowInsets(Insets.of(c1863.f6252, c1863.f6253, c1863.f6254, c1863.f6255));
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ފ.ޕ$ހ, reason: contains not printable characters */
    public static class C1940 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final C1937 f6398 = new C1937((C1937) null);

        /* JADX INFO: renamed from: ֏ */
        public C1937 mo3801() {
            throw null;
        }

        /* JADX INFO: renamed from: ֏ */
        public void mo3803(C1863 c1863) {
        }

        /* JADX INFO: renamed from: ؠ */
        public void mo3802(C1863 c1863) {
            throw null;
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ފ.ޕ$ށ, reason: contains not printable characters */
    public static class C1941 extends C1945 {

        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public final WindowInsets f6399;

        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public C1863 f6400;

        public C1941(C1937 c1937, WindowInsets windowInsets) {
            super(c1937);
            this.f6400 = null;
            this.f6399 = windowInsets;
        }

        public C1941(C1937 c1937, C1941 c1941) {
            WindowInsets windowInsets = new WindowInsets(c1941.f6399);
            super(c1937);
            this.f6400 = null;
            this.f6399 = windowInsets;
        }

        @Override // p037.p065.p078.C1937.C1945
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public C1937 mo3804(int i, int i2, int i3, int i4) {
            C1937 c1937M3794 = C1937.m3794(this.f6399);
            C1940 c1939 = Build.VERSION.SDK_INT >= 29 ? new C1939(c1937M3794) : new C1938(c1937M3794);
            c1939.mo3802(C1937.m3793(mo3805(), i, i2, i3, i4));
            c1939.mo3803(C1937.m3793(mo3809(), i, i2, i3, i4));
            return c1939.mo3801();
        }

        @Override // p037.p065.p078.C1937.C1945
        /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
        public final C1863 mo3805() {
            if (this.f6400 == null) {
                this.f6400 = C1863.m3668(this.f6399.getSystemWindowInsetLeft(), this.f6399.getSystemWindowInsetTop(), this.f6399.getSystemWindowInsetRight(), this.f6399.getSystemWindowInsetBottom());
            }
            return this.f6400;
        }

        @Override // p037.p065.p078.C1937.C1945
        /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
        public boolean mo3806() {
            return this.f6399.isRound();
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ފ.ޕ$ނ, reason: contains not printable characters */
    public static class C1942 extends C1941 {

        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public C1863 f6401;

        public C1942(C1937 c1937, WindowInsets windowInsets) {
            super(c1937, windowInsets);
            this.f6401 = null;
        }

        public C1942(C1937 c1937, C1942 c1942) {
            super(c1937, c1942);
            this.f6401 = null;
        }

        @Override // p037.p065.p078.C1937.C1945
        /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
        public C1937 mo3807() {
            return C1937.m3794(this.f6399.consumeStableInsets());
        }

        @Override // p037.p065.p078.C1937.C1945
        /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
        public C1937 mo3808() {
            return C1937.m3794(this.f6399.consumeSystemWindowInsets());
        }

        @Override // p037.p065.p078.C1937.C1945
        /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
        public final C1863 mo3809() {
            if (this.f6401 == null) {
                this.f6401 = C1863.m3668(this.f6399.getStableInsetLeft(), this.f6399.getStableInsetTop(), this.f6399.getStableInsetRight(), this.f6399.getStableInsetBottom());
            }
            return this.f6401;
        }

        @Override // p037.p065.p078.C1937.C1945
        /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
        public boolean mo3810() {
            return this.f6399.isConsumed();
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ފ.ޕ$ރ, reason: contains not printable characters */
    public static class C1943 extends C1942 {
        public C1943(C1937 c1937, WindowInsets windowInsets) {
            super(c1937, windowInsets);
        }

        public C1943(C1937 c1937, C1943 c1943) {
            super(c1937, c1943);
        }

        @Override // p037.p065.p078.C1937.C1945
        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (obj instanceof C1943) {
                return Objects.equals(this.f6399, ((C1943) obj).f6399);
            }
            return false;
        }

        @Override // p037.p065.p078.C1937.C1945
        public int hashCode() {
            return this.f6399.hashCode();
        }

        @Override // p037.p065.p078.C1937.C1945
        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public C1937 mo3811() {
            return C1937.m3794(this.f6399.consumeDisplayCutout());
        }

        @Override // p037.p065.p078.C1937.C1945
        /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
        public C1909 mo3812() {
            DisplayCutout displayCutout = this.f6399.getDisplayCutout();
            if (displayCutout == null) {
                return null;
            }
            return new C1909(displayCutout);
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ފ.ޕ$ބ, reason: contains not printable characters */
    public static class C1944 extends C1943 {
        public C1944(C1937 c1937, WindowInsets windowInsets) {
            super(c1937, windowInsets);
        }

        public C1944(C1937 c1937, C1944 c1944) {
            super(c1937, c1944);
        }

        @Override // p037.p065.p078.C1937.C1941, p037.p065.p078.C1937.C1945
        /* JADX INFO: renamed from: ֏ */
        public C1937 mo3804(int i, int i2, int i3, int i4) {
            return C1937.m3794(this.f6399.inset(i, i2, i3, i4));
        }
    }

    /* JADX INFO: renamed from: މ.ރ.ފ.ޕ$ޅ, reason: contains not printable characters */
    public static class C1945 {

        /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
        public final C1937 f6402;

        public C1945(C1937 c1937) {
            this.f6402 = c1937;
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof C1945)) {
                return false;
            }
            C1945 c1945 = (C1945) obj;
            return mo3806() == c1945.mo3806() && mo3810() == c1945.mo3810() && Objects.equals(mo3805(), c1945.mo3805()) && Objects.equals(mo3809(), c1945.mo3809()) && Objects.equals(mo3812(), c1945.mo3812());
        }

        public int hashCode() {
            return Objects.hash(Boolean.valueOf(mo3806()), Boolean.valueOf(mo3810()), mo3805(), mo3809(), mo3812());
        }

        /* JADX INFO: renamed from: ֏ */
        public C1937 mo3811() {
            return this.f6402;
        }

        /* JADX INFO: renamed from: ֏ */
        public C1937 mo3804(int i, int i2, int i3, int i4) {
            return C1937.f6390;
        }

        /* JADX INFO: renamed from: ؠ */
        public C1937 mo3807() {
            return this.f6402;
        }

        /* JADX INFO: renamed from: ހ */
        public C1937 mo3808() {
            return this.f6402;
        }

        /* JADX INFO: renamed from: ށ */
        public C1909 mo3812() {
            return null;
        }

        /* JADX INFO: renamed from: ނ */
        public C1863 mo3809() {
            return C1863.f6251;
        }

        /* JADX INFO: renamed from: ރ */
        public C1863 mo3805() {
            return C1863.f6251;
        }

        /* JADX INFO: renamed from: ބ */
        public boolean mo3810() {
            return false;
        }

        /* JADX INFO: renamed from: ޅ */
        public boolean mo3806() {
            return false;
        }
    }

    static {
        f6390 = (Build.VERSION.SDK_INT >= 29 ? new C1939() : new C1938()).mo3801().f6391.mo3811().f6391.mo3807().f6391.mo3808();
    }

    public C1937(WindowInsets windowInsets) {
        int i = Build.VERSION.SDK_INT;
        if (i >= 29) {
            this.f6391 = new C1944(this, windowInsets);
        } else if (i >= 28) {
            this.f6391 = new C1943(this, windowInsets);
        } else {
            this.f6391 = new C1942(this, windowInsets);
        }
    }

    public C1937(C1937 c1937) {
        if (c1937 == null) {
            this.f6391 = new C1945(this);
            return;
        }
        C1945 c1945 = c1937.f6391;
        if (Build.VERSION.SDK_INT >= 29 && (c1945 instanceof C1944)) {
            this.f6391 = new C1944(this, (C1944) c1945);
            return;
        }
        if (Build.VERSION.SDK_INT >= 28 && (c1945 instanceof C1943)) {
            this.f6391 = new C1943(this, (C1943) c1945);
            return;
        }
        if (c1945 instanceof C1942) {
            this.f6391 = new C1942(this, (C1942) c1945);
        } else if (c1945 instanceof C1941) {
            this.f6391 = new C1941(this, (C1941) c1945);
        } else {
            this.f6391 = new C1945(this);
        }
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C1863 m3793(C1863 c1863, int i, int i2, int i3, int i4) {
        int iMax = Math.max(0, c1863.f6252 - i);
        int iMax2 = Math.max(0, c1863.f6253 - i2);
        int iMax3 = Math.max(0, c1863.f6254 - i3);
        int iMax4 = Math.max(0, c1863.f6255 - i4);
        return (iMax == i && iMax2 == i2 && iMax3 == i3 && iMax4 == i4) ? c1863 : C1863.m3668(iMax, iMax2, iMax3, iMax4);
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public static C1937 m3794(WindowInsets windowInsets) {
        if (windowInsets != null) {
            return new C1937(windowInsets);
        }
        throw null;
    }

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof C1937) {
            return Objects.equals(this.f6391, ((C1937) obj).f6391);
        }
        return false;
    }

    public int hashCode() {
        C1945 c1945 = this.f6391;
        if (c1945 == null) {
            return 0;
        }
        return c1945.hashCode();
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public int m3795() {
        return m3799().f6255;
    }

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public int m3796() {
        return m3799().f6252;
    }

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public int m3797() {
        return m3799().f6254;
    }

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public int m3798() {
        return m3799().f6253;
    }

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public C1863 m3799() {
        return this.f6391.mo3805();
    }

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public WindowInsets m3800() {
        C1945 c1945 = this.f6391;
        if (c1945 instanceof C1941) {
            return ((C1941) c1945).f6399;
        }
        return null;
    }
}
