package xyz.stream.utils;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Parcel;
import android.util.Base64;
import android.util.JsonWriter;
import android.util.SparseArray;
import android.view.KeyEvent;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.FrameLayout;
import androidx.appcompat.widget.Toolbar;
import androidx.core.view.b2;
import androidx.fragment.app.t0;
import com.bumptech.glide.manager.RequestManagerFragment;
import com.bytedance.sdk.openadsdk.api.open.PAGAppOpenAdInteractionListener;
import com.google.android.gms.internal.atv_ads_framework.d1;
import com.google.android.gms.measurement.internal.u1;
import com.google.android.material.navigation.NavigationView;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import ie.n0;
import io.flutter.embedding.engine.mutatorsstack.FlutterMutatorView;
import io.flutter.embedding.engine.systemchannels.PlatformViewsChannel$PlatformViewCreationRequest$RequestedDisplayMode;
import io.flutter.plugin.platform.PlatformViewWrapper;
import io.flutter.plugin.platform.SingleViewPresentation;
import java.io.IOException;
import java.io.Serializable;
import java.lang.ref.WeakReference;
import java.lang.reflect.Field;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import org.drive_hunter.R;
import xyz.stream.utils.f0;
import xyz.stream.view.OnItemListener;
import xyz.stream.view.UiUtils;
import xyz.stream.view.listener.OnFragmentScrollListener;
import xyz.stream.view.listener.OnFragmentSendDataListener;

/* JADX INFO: loaded from: classes3.dex */
public final class f0 implements e.d, b2, k.n, n5.m, q7.f, com.google.android.gms.common.api.internal.p, com.google.android.material.datepicker.n, ed.f, dd.w, PAGAppOpenAdInteractionListener, ag.b, OnItemListener {

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static volatile f0 f36134c;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f36135a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Object f36136b;

    public /* synthetic */ f0(int i10, int i11) {
        this.f36135a = i10;
    }

    public static f0 e(byte[] bArr, da.e eVar) {
        if (eVar != null) {
            return new f0(ta.a.a(bArr), 19);
        }
        throw new NullPointerException("SecretKeyAccess required");
    }

    public static f0 o() {
        if (f36134c == null) {
            synchronized (f0.class) {
                try {
                    if (f36134c == null) {
                        int i10 = 0;
                        f36134c = new f0(i10, i10);
                    }
                } finally {
                }
            }
        }
        return f36134c;
    }

    public static boolean r(Integer num) {
        if (num == null || num.intValue() <= 0) {
            return false;
        }
        ArrayList arrayListM = o().m(Integer.class, "sp_dislike_list");
        if (arrayListM.isEmpty()) {
            return false;
        }
        return arrayListM.contains(num);
    }

    public static f0 x(int i10) {
        return new f0(ta.a.a(ma.j0.a(i10)), 19);
    }

    public final void A(Object obj, Serializable serializable) {
        try {
            ((Field) this.f36136b).set(obj, serializable);
        } catch (IllegalAccessException e10) {
            throw new AssertionError(e10);
        }
    }

    public final void B(Object obj, String str) {
        if (((SharedPreferences) this.f36136b) == null) {
            return;
        }
        i().putString(str, m.a(obj)).apply();
    }

    public final void C(String str, List list) {
        if (((SharedPreferences) this.f36136b) == null) {
            return;
        }
        i().putString(str, m.a(list)).apply();
    }

    public final void D(int i10, int i11) {
        View view;
        if (i11 != 0 && i11 != 1) {
            throw new IllegalStateException("Trying to set unknown direction value: " + i11 + "(view id: " + i10 + ")");
        }
        if (((io.flutter.plugin.platform.r) this.f36136b).u(i10)) {
            view = ((io.flutter.plugin.platform.c0) ((io.flutter.plugin.platform.r) this.f36136b).f28238g.get(Integer.valueOf(i10))).b();
        } else {
            io.flutter.plugin.platform.i iVar = (io.flutter.plugin.platform.i) ((io.flutter.plugin.platform.r) this.f36136b).f28240i.get(i10);
            if (iVar == null) {
                return;
            } else {
                view = iVar.getView();
            }
        }
        if (view == null) {
            return;
        }
        view.setLayoutDirection(i11);
    }

    public final int E() {
        return ((ta.a) this.f36136b).f33001a.length;
    }

    public final byte[] F(da.e eVar) {
        if (eVar != null) {
            return ((ta.a) this.f36136b).b();
        }
        throw new NullPointerException("SecretKeyAccess required");
    }

    @Override // ag.b
    public final void a() {
    }

    @Override // com.google.android.gms.common.api.internal.p
    public final void accept(Object obj, Object obj2) {
        n8.e eVar = (n8.e) ((n8.b) obj).getService();
        z7.c cVar = new z7.c(null, null);
        n8.f fVar = new n8.f((w8.i) obj2);
        eVar.getClass();
        Parcel parcelObtain = Parcel.obtain();
        parcelObtain.writeInterfaceToken("com.google.android.gms.appset.internal.IAppSetService");
        int i10 = n8.a.f31100a;
        parcelObtain.writeInt(1);
        cVar.writeToParcel(parcelObtain, 0);
        parcelObtain.writeStrongBinder(fVar);
        Parcel parcelObtain2 = Parcel.obtain();
        try {
            eVar.f31101a.transact(1, parcelObtain, parcelObtain2, 0);
            parcelObtain2.readException();
        } finally {
            parcelObtain.recycle();
            parcelObtain2.recycle();
        }
    }

    public final v6.m b() {
        Context context = (Context) this.f36136b;
        if (context == null) {
            throw new IllegalStateException(Context.class.getCanonicalName() + " must be set");
        }
        v6.m mVar = new v6.m();
        mVar.f33711a = x6.a.a(v6.r.f33719a);
        if (context == null) {
            throw new NullPointerException("instance cannot be null");
        }
        a0 a0Var = new a0(context);
        mVar.f33712b = a0Var;
        androidx.window.core.h hVar = e7.b.f25507a;
        com.google.android.gms.measurement.internal.a0 a0Var2 = e7.b.f25508b;
        mVar.f33713c = x6.a.a(new d1(a0Var, new w6.k(a0Var, hVar, a0Var2, 0), 9));
        a0 a0Var3 = mVar.f33712b;
        mVar.f33714d = new w6.k(a0Var3, c7.e.f4918a, c7.e.f4919b, 1);
        jd.a aVarA = x6.a.a(new v6.z(hVar, a0Var2, c7.e.f4920c, mVar.f33714d, x6.a.a(new e.y(a0Var3)), 2));
        mVar.f33715e = aVarA;
        nb.c cVar = new nb.c(hVar, 14);
        a0 a0Var4 = mVar.f33712b;
        a7.c cVar2 = new a7.c(a0Var4, aVarA, cVar, a0Var2, 0);
        jd.a aVar = mVar.f33711a;
        jd.a aVar2 = mVar.f33713c;
        v6.z zVar = new v6.z(aVar, aVar2, cVar2, aVarA, aVarA, 1);
        e6.a aVar3 = new e6.a();
        aVar3.f25486a = a0Var4;
        aVar3.f25487b = aVar2;
        aVar3.f25488c = aVarA;
        aVar3.f25489d = cVar2;
        aVar3.f25490e = aVar;
        aVar3.f25491f = aVarA;
        aVar3.f25492g = hVar;
        aVar3.f25493h = a0Var2;
        aVar3.f25494i = aVarA;
        mVar.f33716f = x6.a.a(new v6.z(hVar, a0Var2, zVar, aVar3, new a7.c(aVar, aVarA, cVar2, aVarA, 1), 0));
        return mVar;
    }

    @Override // q7.f
    public final void c(JsonWriter jsonWriter) throws IOException {
        Object obj = q7.g.f32230b;
        jsonWriter.name("params").beginObject();
        byte[] bArr = (byte[]) this.f36136b;
        int length = bArr.length;
        String strEncodeToString = Base64.encodeToString(bArr, 0);
        if (length < 10000) {
            jsonWriter.name("body").value(strEncodeToString);
        } else {
            String strZzf = q7.e.zzf(strEncodeToString);
            if (strZzf != null) {
                jsonWriter.name("bodydigest").value(strZzf);
            }
        }
        jsonWriter.name("bodylength").value(length);
        jsonWriter.endObject();
    }

    public final void d(int i10) {
        View view;
        if (((io.flutter.plugin.platform.r) this.f36136b).u(i10)) {
            view = ((io.flutter.plugin.platform.c0) ((io.flutter.plugin.platform.r) this.f36136b).f28238g.get(Integer.valueOf(i10))).b();
        } else {
            io.flutter.plugin.platform.i iVar = (io.flutter.plugin.platform.i) ((io.flutter.plugin.platform.r) this.f36136b).f28240i.get(i10);
            if (iVar == null) {
                return;
            } else {
                view = iVar.getView();
            }
        }
        if (view == null) {
            return;
        }
        view.clearFocus();
    }

    @Override // k.n
    public final boolean f(k.p pVar, MenuItem menuItem) {
        switch (this.f36135a) {
            case 3:
                k.n nVar = ((Toolbar) this.f36136b).f831u0;
                if (nVar == null || !nVar.f(pVar, menuItem)) {
                }
                break;
            default:
                ((NavigationView) this.f36136b).getClass();
                break;
        }
        return false;
    }

    public final long g(dd.t tVar) {
        io.flutter.plugin.platform.r.c((io.flutter.plugin.platform.r) this.f36136b, tVar);
        SparseArray sparseArray = ((io.flutter.plugin.platform.r) this.f36136b).f28243l;
        int i10 = tVar.f25147a;
        if (sparseArray.get(i10) != null) {
            throw new IllegalStateException(u1.g("Trying to create an already created platform view, view id: ", i10));
        }
        if (((io.flutter.plugin.platform.r) this.f36136b).textureRegistry == null) {
            throw new IllegalStateException(u1.g("Texture registry is null. This means that platform views controller was detached, view id: ", i10));
        }
        io.flutter.plugin.platform.r rVar = (io.flutter.plugin.platform.r) this.f36136b;
        if (rVar.f28235d == null) {
            throw new IllegalStateException(u1.g("Flutter view is null. This means the platform views controller doesn't have an attached view, view id: ", i10));
        }
        io.flutter.plugin.platform.i iVarJ = rVar.j(tVar, true);
        View view = iVarJ.getView();
        if (view.getParent() != null) {
            throw new IllegalStateException("The Android view returned from PlatformView#getView() was already added to a parent view.");
        }
        if (id.e.hasChildViewOfType(view, io.flutter.plugin.platform.r.f28231u)) {
            if (tVar.f25154h == PlatformViewsChannel$PlatformViewCreationRequest$RequestedDisplayMode.f28089b) {
                ((io.flutter.plugin.platform.r) this.f36136b).getClass();
                io.flutter.plugin.platform.r.n(19);
                return -2L;
            }
            io.flutter.plugin.platform.r rVar2 = (io.flutter.plugin.platform.r) this.f36136b;
            if (!rVar2.f28250s) {
                return io.flutter.plugin.platform.r.g(rVar2, iVarJ, tVar);
            }
        }
        return ((io.flutter.plugin.platform.r) this.f36136b).i(iVarJ, tVar);
    }

    public final void h(int i10) {
        io.flutter.plugin.platform.m mVar;
        io.flutter.plugin.platform.i iVar = (io.flutter.plugin.platform.i) ((io.flutter.plugin.platform.r) this.f36136b).f28240i.get(i10);
        if (iVar == null) {
            return;
        }
        if (iVar.getView() != null) {
            View view = iVar.getView();
            ViewGroup viewGroup = (ViewGroup) view.getParent();
            if (viewGroup != null) {
                viewGroup.removeView(view);
            }
        }
        ((io.flutter.plugin.platform.r) this.f36136b).f28240i.remove(i10);
        try {
            iVar.dispose();
        } catch (RuntimeException unused) {
        }
        if (((io.flutter.plugin.platform.r) this.f36136b).u(i10)) {
            io.flutter.plugin.platform.c0 c0Var = (io.flutter.plugin.platform.c0) ((io.flutter.plugin.platform.r) this.f36136b).f28238g.get(Integer.valueOf(i10));
            View viewB = c0Var.b();
            if (viewB != null) {
                ((io.flutter.plugin.platform.r) this.f36136b).f28239h.remove(viewB.getContext());
            }
            c0Var.a();
            ((io.flutter.plugin.platform.r) this.f36136b).f28238g.remove(Integer.valueOf(i10));
            return;
        }
        PlatformViewWrapper platformViewWrapper = (PlatformViewWrapper) ((io.flutter.plugin.platform.r) this.f36136b).f28243l.get(i10);
        if (platformViewWrapper == null) {
            FlutterMutatorView flutterMutatorView = (FlutterMutatorView) ((io.flutter.plugin.platform.r) this.f36136b).f28241j.get(i10);
            if (flutterMutatorView != null) {
                flutterMutatorView.removeAllViews();
                flutterMutatorView.a();
                ViewGroup viewGroup2 = (ViewGroup) flutterMutatorView.getParent();
                if (viewGroup2 != null) {
                    viewGroup2.removeView(flutterMutatorView);
                }
                ((io.flutter.plugin.platform.r) this.f36136b).f28241j.remove(i10);
                return;
            }
            return;
        }
        platformViewWrapper.removeAllViews();
        io.flutter.plugin.platform.l lVar = platformViewWrapper.f28185f;
        if (lVar != null) {
            lVar.release();
            platformViewWrapper.f28185f = null;
        }
        ViewTreeObserver viewTreeObserver = platformViewWrapper.getViewTreeObserver();
        if (viewTreeObserver.isAlive() && (mVar = platformViewWrapper.f28186g) != null) {
            platformViewWrapper.f28186g = null;
            viewTreeObserver.removeOnGlobalFocusChangeListener(mVar);
        }
        ViewGroup viewGroup3 = (ViewGroup) platformViewWrapper.getParent();
        if (viewGroup3 != null) {
            viewGroup3.removeView(platformViewWrapper);
        }
        ((io.flutter.plugin.platform.r) this.f36136b).f28243l.remove(i10);
    }

    public final SharedPreferences.Editor i() {
        return ((SharedPreferences) this.f36136b).edit();
    }

    public final boolean j(String str, Boolean bool) {
        Object obj = this.f36136b;
        return ((SharedPreferences) obj) == null ? bool.booleanValue() : ((SharedPreferences) obj).getBoolean(str, bool.booleanValue());
    }

    public final Object k(Class cls, String str) {
        String string;
        SharedPreferences sharedPreferences = (SharedPreferences) this.f36136b;
        if (sharedPreferences == null || (string = sharedPreferences.getString(str, null)) == null || string.equals("null") || string.isEmpty()) {
            return null;
        }
        if (string.startsWith("{") && string.endsWith("}")) {
            return m.f36162a.fromJson(string, cls);
        }
        if (string.startsWith("\"") && string.endsWith("\"")) {
            return m.f36162a.fromJson(string.substring(1, string.length() - 1).replace("\\\"", "\"").replace("\\\\", "\\"), cls);
        }
        return null;
    }

    @Override // k.n
    public final void l(k.p pVar) {
        switch (this.f36135a) {
            case 3:
                l.p pVar2 = ((Toolbar) this.f36136b).f798a.W;
                if (pVar2 == null || !pVar2.g()) {
                    Iterator it = ((Toolbar) this.f36136b).f823m0.f1710b.iterator();
                    while (it.hasNext()) {
                        ((t0) ((androidx.core.view.c0) it.next())).f2595a.r(pVar);
                    }
                }
                k.n nVar = ((Toolbar) this.f36136b).f831u0;
                if (nVar != null) {
                    nVar.l(pVar);
                }
                break;
        }
    }

    public final ArrayList m(Class cls, String str) {
        String string;
        ArrayList arrayList = new ArrayList();
        SharedPreferences sharedPreferences = (SharedPreferences) this.f36136b;
        if (sharedPreferences == null || (string = sharedPreferences.getString(str, null)) == null) {
            return arrayList;
        }
        ArrayList arrayList2 = new ArrayList();
        if (!string.isEmpty() && !string.equals("null")) {
            Iterator<JsonElement> it = new JsonParser().parse(string).getAsJsonArray().iterator();
            while (it.hasNext()) {
                arrayList2.add(m.f36162a.fromJson(it.next(), cls));
            }
        }
        return arrayList2;
    }

    public final float n(Object obj, String str) {
        HashMap map;
        float[] fArr;
        if (((HashMap) this.f36136b).containsKey(obj) && (map = (HashMap) ((HashMap) this.f36136b).get(obj)) != null && map.containsKey(str) && (fArr = (float[]) map.get(str)) != null && fArr.length > 0) {
            return fArr[0];
        }
        return Float.NaN;
    }

    @Override // com.bytedance.sdk.openadsdk.api.PAGAdListener
    public final void onAdClicked() {
        ((xyz.netfly.ads.m) this.f36136b).f34868c.getClass();
        xyz.netfly.ads.r.i("open_ad", "Clicked");
    }

    @Override // com.bytedance.sdk.openadsdk.api.PAGAdListener
    public final void onAdDismissed() {
        ((xyz.netfly.ads.m) this.f36136b).f34868c.getClass();
        xyz.netfly.ads.r.i("open_ad", "Dismissed");
        xyz.netfly.ads.m mVar = (xyz.netfly.ads.m) this.f36136b;
        mVar.f34868c.c(mVar.f34866a);
    }

    @Override // com.bytedance.sdk.openadsdk.api.PAGAdListener
    public final void onAdShowed() {
        ((xyz.netfly.ads.m) this.f36136b).f34868c.getClass();
        xyz.netfly.ads.r.i("open_ad", "Showed");
    }

    @Override // ag.b
    public final void onCancelClick() {
        switch (this.f36135a) {
            case 25:
                xyz.netfly.player.n nVar = (xyz.netfly.player.n) this.f36136b;
                nVar.f35238x = null;
                WeakReference weakReference = nVar.f35223i;
                if (weakReference != null && weakReference.get() != null) {
                    ((wf.a) ((xyz.netfly.player.n) this.f36136b).f35223i.get()).d();
                    break;
                }
                break;
            default:
                ((rf.w) this.f36136b).D();
                break;
        }
    }

    @Override // xyz.stream.view.OnItemListener
    public final void onItemClick(View view, int i10) {
        super.onItemClick(view, i10);
        if (((cf.c) this.f36136b).J0) {
            onItemLongClick(view, i10);
        }
    }

    @Override // xyz.stream.view.OnItemListener
    public final void onItemFocus(View view, int i10) {
        super.onItemFocus(view, i10);
        if (i10 < ((cf.c) this.f36136b).F0.size() - 4 || ((cf.c) this.f36136b).I0.isLoading() || !((cf.c) this.f36136b).I0.isHasMore()) {
            return;
        }
        ((n0) ((cf.c) this.f36136b).binding).f27248d.autoLoadMore();
    }

    @Override // xyz.stream.view.OnItemListener
    public final boolean onItemKey(View view, int i10, KeyEvent keyEvent, int i11) {
        if (i10 == 82 && keyEvent.getAction() == 0) {
            onItemLongClick(view, i11);
            return true;
        }
        if (i11 % 4 == 0 && keyEvent.getAction() == 0 && UiUtils.isDpadLeft(i10)) {
            cf.c cVar = (cf.c) this.f36136b;
            cVar.G0 = i11;
            OnFragmentSendDataListener onFragmentSendDataListener = cVar.onFragmentSendDataListener;
            if (onFragmentSendDataListener != null) {
                onFragmentSendDataListener.onActivityFocus();
            }
            return true;
        }
        if (i11 == ((cf.c) this.f36136b).F0.size() - 1 && keyEvent.getAction() == 0 && UiUtils.isDpadRight(i10)) {
            return true;
        }
        if (i11 >= ((cf.c) this.f36136b).F0.size() - 4 && keyEvent.getAction() == 0 && i10 == 20) {
            return true;
        }
        if (i11 >= 4 || keyEvent.getAction() != 0 || i10 != 19) {
            if (i11 < 4) {
                return keyEvent.getAction() == 1 && i10 == 20;
            }
            return false;
        }
        OnFragmentScrollListener onFragmentScrollListener = ((cf.c) this.f36136b).onFragmentScrollListener;
        if (onFragmentScrollListener != null) {
            onFragmentScrollListener.onCategoryFocus();
        }
        return true;
    }

    @Override // xyz.stream.view.OnItemListener
    public final void onItemLongClick(View view, int i10) {
        uf.r.e(((cf.c) this.f36136b).requireActivity(), ((cf.c) this.f36136b).getString(R.string.remove_my_list), new androidx.media3.common.p(i10, 6, this));
    }

    @Override // ed.f
    public final void onMessage(ByteBuffer byteBuffer, ed.g gVar) {
        ((yc.d) this.f36136b).isolateServiceId = ed.b0.f25831b.decodeMessage(byteBuffer);
        ((yc.d) this.f36136b).getClass();
    }

    public final int p(String str, int i10) {
        Object obj = this.f36136b;
        return ((SharedPreferences) obj) == null ? i10 : ((SharedPreferences) obj).getInt(str, i10);
    }

    public final String q(String str, String str2) {
        Object obj = this.f36136b;
        return ((SharedPreferences) obj) == null ? str2 : ((SharedPreferences) obj).getString(str, str2);
    }

    public final void s(int i10, double d10, double d11) {
        PlatformViewWrapper platformViewWrapper;
        if (((io.flutter.plugin.platform.r) this.f36136b).u(i10) || (platformViewWrapper = (PlatformViewWrapper) ((io.flutter.plugin.platform.r) this.f36136b).f28243l.get(i10)) == null) {
            return;
        }
        int iT = ((io.flutter.plugin.platform.r) this.f36136b).t(d10);
        int iT2 = ((io.flutter.plugin.platform.r) this.f36136b).t(d11);
        FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) platformViewWrapper.getLayoutParams();
        layoutParams.topMargin = iT;
        layoutParams.leftMargin = iT2;
        platformViewWrapper.setLayoutParams(layoutParams);
    }

    public final void t(dd.v vVar) {
        View view;
        float f10 = ((io.flutter.plugin.platform.r) this.f36136b).f28234c.getResources().getDisplayMetrics().density;
        io.flutter.plugin.platform.r rVar = (io.flutter.plugin.platform.r) this.f36136b;
        int i10 = vVar.f25158a;
        if (!rVar.u(i10)) {
            io.flutter.plugin.platform.i iVar = (io.flutter.plugin.platform.i) ((io.flutter.plugin.platform.r) this.f36136b).f28240i.get(i10);
            if (iVar == null || (view = iVar.getView()) == null) {
                return;
            }
            view.dispatchTouchEvent(((io.flutter.plugin.platform.r) this.f36136b).s(f10, vVar, false));
            return;
        }
        io.flutter.plugin.platform.c0 c0Var = (io.flutter.plugin.platform.c0) ((io.flutter.plugin.platform.r) this.f36136b).f28238g.get(Integer.valueOf(i10));
        MotionEvent motionEventS = ((io.flutter.plugin.platform.r) this.f36136b).s(f10, vVar, true);
        SingleViewPresentation singleViewPresentation = c0Var.f28200a;
        if (singleViewPresentation == null) {
            return;
        }
        singleViewPresentation.dispatchTouchEvent(motionEventS);
    }

    public final String toString() {
        switch (this.f36135a) {
            case 10:
                return super.toString() + "{fragment=" + ((RequestManagerFragment) this.f36136b) + "}";
            default:
                return super.toString();
        }
    }

    public final void u(String str, Boolean bool) {
        if (((SharedPreferences) this.f36136b) == null) {
            return;
        }
        i().putBoolean(str, bool.booleanValue()).apply();
    }

    public final void v(int i10, String str) {
        if (((SharedPreferences) this.f36136b) == null) {
            return;
        }
        i().putInt(str, i10).apply();
    }

    public final void w(String str, String str2) {
        if (((SharedPreferences) this.f36136b) == null || str == null) {
            return;
        }
        i().putString(str, str2).apply();
    }

    public final void y(String str) {
        if (((SharedPreferences) this.f36136b) == null) {
            return;
        }
        i().remove(str).apply();
    }

    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r3v15, types: [io.flutter.plugin.platform.q] */
    public final void z(dd.u uVar, final com.baseflow.permissionhandler.a aVar) {
        io.flutter.plugin.platform.l lVar;
        int iT = ((io.flutter.plugin.platform.r) this.f36136b).t(uVar.f25156b);
        int iT2 = ((io.flutter.plugin.platform.r) this.f36136b).t(uVar.f25157c);
        io.flutter.plugin.platform.r rVar = (io.flutter.plugin.platform.r) this.f36136b;
        int i10 = uVar.f25155a;
        if (rVar.u(i10)) {
            final float fP = ((io.flutter.plugin.platform.r) this.f36136b).p();
            final io.flutter.plugin.platform.c0 c0Var = (io.flutter.plugin.platform.c0) ((io.flutter.plugin.platform.r) this.f36136b).f28238g.get(Integer.valueOf(i10));
            io.flutter.plugin.platform.r.d((io.flutter.plugin.platform.r) this.f36136b, c0Var);
            c0Var.c(iT, iT2, new Runnable() { // from class: io.flutter.plugin.platform.q
                @Override // java.lang.Runnable
                public final void run() {
                    f0 f0Var = this.f28227a;
                    r rVar2 = (r) f0Var.f36136b;
                    c0 c0Var2 = c0Var;
                    r.e(rVar2, c0Var2);
                    r rVar3 = (r) f0Var.f36136b;
                    float fP2 = rVar3.f28234c == null ? fP : rVar3.p();
                    r rVar4 = (r) f0Var.f36136b;
                    l lVar2 = c0Var2.f28205f;
                    int width = lVar2 != null ? lVar2.getWidth() : 0;
                    rVar4.getClass();
                    double d10 = fP2;
                    int iRound = (int) Math.round(((double) width) / d10);
                    r rVar5 = (r) f0Var.f36136b;
                    l lVar3 = c0Var2.f28205f;
                    int height = lVar3 != null ? lVar3.getHeight() : 0;
                    rVar5.getClass();
                    ((com.baseflow.permissionhandler.a) aVar).run(new dd.s(iRound, (int) Math.round(((double) height) / d10)));
                }
            });
            return;
        }
        io.flutter.plugin.platform.i iVar = (io.flutter.plugin.platform.i) ((io.flutter.plugin.platform.r) this.f36136b).f28240i.get(i10);
        PlatformViewWrapper platformViewWrapper = (PlatformViewWrapper) ((io.flutter.plugin.platform.r) this.f36136b).f28243l.get(i10);
        if (iVar == null || platformViewWrapper == null) {
            return;
        }
        if ((iT > platformViewWrapper.getRenderTargetWidth() || iT2 > platformViewWrapper.getRenderTargetHeight()) && (lVar = platformViewWrapper.f28185f) != null) {
            lVar.i(iT, iT2);
        }
        ViewGroup.LayoutParams layoutParams = platformViewWrapper.getLayoutParams();
        layoutParams.width = iT;
        layoutParams.height = iT2;
        platformViewWrapper.setLayoutParams(layoutParams);
        View view = iVar.getView();
        if (view != null) {
            ViewGroup.LayoutParams layoutParams2 = view.getLayoutParams();
            layoutParams2.width = iT;
            layoutParams2.height = iT2;
            view.setLayoutParams(layoutParams2);
        }
        aVar.run(new dd.s((int) Math.round(((double) platformViewWrapper.getRenderTargetWidth()) / ((double) ((io.flutter.plugin.platform.r) this.f36136b).p())), (int) Math.round(((double) platformViewWrapper.getRenderTargetHeight()) / ((double) ((io.flutter.plugin.platform.r) this.f36136b).p()))));
    }

    public /* synthetic */ f0(Object obj, int i10) {
        this.f36135a = i10;
        this.f36136b = obj;
    }

    public f0(int i10) {
        this.f36135a = i10;
        if (i10 != 20) {
            this.f36136b = new HashMap();
        } else {
            this.f36136b = null;
        }
    }

    public f0(boolean z10) {
        this.f36135a = 6;
        this.f36136b = new AtomicBoolean(z10);
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ f0() {
        this(11, 0);
        this.f36135a = 11;
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public /* synthetic */ f0(Field field, int i10) {
        this(field);
        this.f36135a = 18;
    }

    public f0(Field field) {
        this.f36135a = 18;
        this.f36136b = field;
        field.setAccessible(true);
    }
}
