package com.google.maps.android.compose;

import androidx.compose.runtime.ComposablesKt;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.RecomposeScopeImplKt;
import androidx.compose.runtime.ScopeUpdateScope;
import androidx.compose.runtime.Updater;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.TileOverlay;
import com.google.android.gms.maps.model.TileOverlayOptions;
import com.google.android.gms.maps.model.TileProvider;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;

/* JADX INFO: compiled from: TileOverlay.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u00000\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0007\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u001aS\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\b\b\u0002\u0010\u0004\u001a\u00020\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u00072\b\b\u0002\u0010\b\u001a\u00020\u00052\b\b\u0002\u0010\t\u001a\u00020\u00072\u0014\b\u0002\u0010\n\u001a\u000e\u0012\u0004\u0012\u00020\f\u0012\u0004\u0012\u00020\u00010\u000bH\u0007¢\u0006\u0002\u0010\r\u001a]\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\b\b\u0002\u0010\u000e\u001a\u00020\u000f2\b\b\u0002\u0010\u0004\u001a\u00020\u00052\b\b\u0002\u0010\u0006\u001a\u00020\u00072\b\b\u0002\u0010\b\u001a\u00020\u00052\b\b\u0002\u0010\t\u001a\u00020\u00072\u0014\b\u0002\u0010\n\u001a\u000e\u0012\u0004\u0012\u00020\f\u0012\u0004\u0012\u00020\u00010\u000bH\u0007¢\u0006\u0002\u0010\u0010\u001a\r\u0010\u0011\u001a\u00020\u000fH\u0007¢\u0006\u0002\u0010\u0012¨\u0006\u0013"}, d2 = {"TileOverlay", "", "tileProvider", "Lcom/google/android/gms/maps/model/TileProvider;", "fadeIn", "", "transparency", "", "visible", "zIndex", "onClick", "Lkotlin/Function1;", "Lcom/google/android/gms/maps/model/TileOverlay;", "(Lcom/google/android/gms/maps/model/TileProvider;ZFZFLkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V", "state", "Lcom/google/maps/android/compose/TileOverlayState;", "(Lcom/google/android/gms/maps/model/TileProvider;Lcom/google/maps/android/compose/TileOverlayState;ZFZFLkotlin/jvm/functions/Function1;Landroidx/compose/runtime/Composer;II)V", "rememberTileOverlayState", "(Landroidx/compose/runtime/Composer;I)Lcom/google/maps/android/compose/TileOverlayState;", "maps-compose_release"}, k = 2, mv = {2, 0, 0}, xi = 48)
public final class TileOverlayKt {
    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit TileOverlay$lambda$1(TileProvider tileProvider, boolean z, float f, boolean z2, float f2, Function1 function1, int i, int i2, Composer composer, int i3) {
        Intrinsics.checkNotNullParameter(tileProvider, "$tileProvider");
        TileOverlay(tileProvider, z, f, z2, f2, function1, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1), i2);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit TileOverlay$lambda$13(TileProvider tileProvider, TileOverlayState tileOverlayState, boolean z, float f, boolean z2, float f2, Function1 function1, int i, int i2, Composer composer, int i3) {
        Intrinsics.checkNotNullParameter(tileProvider, "$tileProvider");
        TileOverlay(tileProvider, tileOverlayState, z, f, z2, f2, function1, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1), i2);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit TileOverlay$lambda$0(TileOverlay it) {
        Intrinsics.checkNotNullParameter(it, "it");
        return Unit.INSTANCE;
    }

    @Deprecated(level = DeprecationLevel.HIDDEN, message = "For compatibility")
    public static final /* synthetic */ void TileOverlay(final TileProvider tileProvider, boolean z, float f, boolean z2, float f2, Function1 function1, Composer composer, final int i, final int i2) {
        Intrinsics.checkNotNullParameter(tileProvider, "tileProvider");
        Composer composerStartRestartGroup = composer.startRestartGroup(1712508128);
        boolean z3 = (i2 & 2) != 0 ? true : z;
        float f3 = (i2 & 4) != 0 ? 0.0f : f;
        boolean z4 = (i2 & 8) != 0 ? true : z2;
        float f4 = (i2 & 16) != 0 ? 0.0f : f2;
        Function1 function12 = (i2 & 32) != 0 ? new Function1() { // from class: com.google.maps.android.compose.TileOverlayKt$$ExternalSyntheticLambda0
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj) {
                return TileOverlayKt.TileOverlay$lambda$0((TileOverlay) obj);
            }
        } : function1;
        int i3 = i << 3;
        TileOverlay(tileProvider, rememberTileOverlayState(composerStartRestartGroup, 0), z3, f3, z4, f4, function12, composerStartRestartGroup, (i3 & 896) | 8 | (i3 & 7168) | (57344 & i3) | (458752 & i3) | (i3 & 3670016), 0);
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            final boolean z5 = z3;
            final float f5 = f3;
            final boolean z6 = z4;
            final float f6 = f4;
            final Function1 function13 = function12;
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.TileOverlayKt$$ExternalSyntheticLambda2
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return TileOverlayKt.TileOverlay$lambda$1(tileProvider, z5, f5, z6, f6, function13, i, i2, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit TileOverlay$lambda$2(TileOverlay it) {
        Intrinsics.checkNotNullParameter(it, "it");
        return Unit.INSTANCE;
    }

    public static final void TileOverlay(final TileProvider tileProvider, TileOverlayState tileOverlayState, boolean z, float f, boolean z2, float f2, Function1<? super TileOverlay, Unit> function1, Composer composer, final int i, final int i2) {
        Intrinsics.checkNotNullParameter(tileProvider, "tileProvider");
        Composer composerStartRestartGroup = composer.startRestartGroup(-378552693);
        TileOverlayState tileOverlayStateRememberTileOverlayState = (i2 & 2) != 0 ? rememberTileOverlayState(composerStartRestartGroup, 0) : tileOverlayState;
        boolean z3 = (i2 & 4) != 0 ? true : z;
        float f3 = (i2 & 8) != 0 ? 0.0f : f;
        boolean z4 = (i2 & 16) != 0 ? true : z2;
        float f4 = (i2 & 32) != 0 ? 0.0f : f2;
        Function1<? super TileOverlay, Unit> function12 = (i2 & 64) != 0 ? new Function1() { // from class: com.google.maps.android.compose.TileOverlayKt$$ExternalSyntheticLambda3
            @Override // kotlin.jvm.functions.Function1
            public final Object invoke(Object obj) {
                return TileOverlayKt.TileOverlay$lambda$2((TileOverlay) obj);
            }
        } : function1;
        final MapApplier mapApplier = (MapApplier) composerStartRestartGroup.getApplier();
        final TileOverlayState tileOverlayState2 = tileOverlayStateRememberTileOverlayState;
        final Function1<? super TileOverlay, Unit> function13 = function12;
        final boolean z5 = z3;
        final float f5 = f3;
        final TileOverlayState tileOverlayState3 = tileOverlayStateRememberTileOverlayState;
        final boolean z6 = z4;
        final Function1<? super TileOverlay, Unit> function14 = function12;
        final float f6 = f4;
        final Function0 function0 = new Function0() { // from class: com.google.maps.android.compose.TileOverlayKt$$ExternalSyntheticLambda4
            @Override // kotlin.jvm.functions.Function0
            public final Object invoke() {
                return TileOverlayKt.TileOverlay$lambda$4(mapApplier, tileOverlayState2, function13, tileProvider, z5, f5, z6, f6);
            }
        };
        composerStartRestartGroup.startReplaceableGroup(1886828752);
        ComposerKt.sourceInformation(composerStartRestartGroup, "CC(ComposeNode):Composables.kt#9igjgp");
        if (!(composerStartRestartGroup.getApplier() instanceof MapApplier)) {
            ComposablesKt.invalidApplier();
        }
        composerStartRestartGroup.startNode();
        if (composerStartRestartGroup.getInserting()) {
            composerStartRestartGroup.createNode(new Function0<TileOverlayNode>() { // from class: com.google.maps.android.compose.TileOverlayKt$TileOverlay$$inlined$ComposeNode$1
                {
                    super(0);
                }

                /* JADX WARN: Type inference failed for: r0v1, types: [com.google.maps.android.compose.TileOverlayNode, java.lang.Object] */
                @Override // kotlin.jvm.functions.Function0
                public final TileOverlayNode invoke() {
                    return function0.invoke();
                }
            });
        } else {
            composerStartRestartGroup.useNode();
        }
        Composer composerM3820constructorimpl = Updater.m3820constructorimpl(composerStartRestartGroup);
        Updater.m3830updateimpl(composerM3820constructorimpl, function14, (Function2<? super T, ? super Function1<? super TileOverlay, Unit>, Unit>) new Function2() { // from class: com.google.maps.android.compose.TileOverlayKt$$ExternalSyntheticLambda5
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj, Object obj2) {
                return TileOverlayKt.TileOverlay$lambda$12$lambda$5((TileOverlayNode) obj, (Function1) obj2);
            }
        });
        final boolean z7 = z3;
        final float f7 = f3;
        final boolean z8 = z4;
        final float f8 = f4;
        Updater.m3830updateimpl(composerM3820constructorimpl, tileProvider, (Function2<? super T, ? super TileProvider, Unit>) new Function2() { // from class: com.google.maps.android.compose.TileOverlayKt$$ExternalSyntheticLambda6
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj, Object obj2) {
                return TileOverlayKt.TileOverlay$lambda$12$lambda$7(mapApplier, tileProvider, z7, f7, z8, f8, (TileOverlayNode) obj, (TileProvider) obj2);
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, Boolean.valueOf(z3), (Function2<? super T, ? super Boolean, Unit>) new Function2() { // from class: com.google.maps.android.compose.TileOverlayKt$$ExternalSyntheticLambda7
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj, Object obj2) {
                return TileOverlayKt.TileOverlay$lambda$12$lambda$8((TileOverlayNode) obj, ((Boolean) obj2).booleanValue());
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, Float.valueOf(f3), (Function2<? super T, ? super Float, Unit>) new Function2() { // from class: com.google.maps.android.compose.TileOverlayKt$$ExternalSyntheticLambda8
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj, Object obj2) {
                return TileOverlayKt.TileOverlay$lambda$12$lambda$9((TileOverlayNode) obj, ((Float) obj2).floatValue());
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, Boolean.valueOf(z4), (Function2<? super T, ? super Boolean, Unit>) new Function2() { // from class: com.google.maps.android.compose.TileOverlayKt$$ExternalSyntheticLambda9
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj, Object obj2) {
                return TileOverlayKt.TileOverlay$lambda$12$lambda$10((TileOverlayNode) obj, ((Boolean) obj2).booleanValue());
            }
        });
        Updater.m3830updateimpl(composerM3820constructorimpl, Float.valueOf(f4), (Function2<? super T, ? super Float, Unit>) new Function2() { // from class: com.google.maps.android.compose.TileOverlayKt$$ExternalSyntheticLambda10
            @Override // kotlin.jvm.functions.Function2
            public final Object invoke(Object obj, Object obj2) {
                return TileOverlayKt.TileOverlay$lambda$12$lambda$11((TileOverlayNode) obj, ((Float) obj2).floatValue());
            }
        });
        composerStartRestartGroup.endNode();
        composerStartRestartGroup.endReplaceableGroup();
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            final boolean z9 = z3;
            final float f9 = f3;
            final boolean z10 = z4;
            final float f10 = f4;
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.TileOverlayKt$$ExternalSyntheticLambda1
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return TileOverlayKt.TileOverlay$lambda$13(tileProvider, tileOverlayState3, z9, f9, z10, f10, function14, i, i2, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final TileOverlayNode TileOverlay$lambda$4(MapApplier mapApplier, TileOverlayState tileOverlayState, Function1 function1, TileProvider tileProvider, boolean z, float f, boolean z2, float f2) {
        GoogleMap map;
        Intrinsics.checkNotNullParameter(tileProvider, "$tileProvider");
        if (mapApplier != null && (map = mapApplier.getMap()) != null) {
            TileOverlayOptions tileOverlayOptions = new TileOverlayOptions();
            tileOverlayOptions.tileProvider(tileProvider);
            tileOverlayOptions.fadeIn(z);
            tileOverlayOptions.transparency(f);
            tileOverlayOptions.visible(z2);
            tileOverlayOptions.zIndex(f2);
            TileOverlay tileOverlayAddTileOverlay = map.addTileOverlay(tileOverlayOptions);
            if (tileOverlayAddTileOverlay != null) {
                return new TileOverlayNode(tileOverlayAddTileOverlay, tileOverlayState, function1);
            }
        }
        throw new IllegalStateException("Error adding tile overlay".toString());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit TileOverlay$lambda$12$lambda$5(TileOverlayNode update, Function1 it) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        Intrinsics.checkNotNullParameter(it, "it");
        update.setOnTileOverlayClick(it);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit TileOverlay$lambda$12$lambda$7(MapApplier mapApplier, TileProvider tileProvider, boolean z, float f, boolean z2, float f2, TileOverlayNode update, TileProvider it) {
        GoogleMap map;
        Intrinsics.checkNotNullParameter(tileProvider, "$tileProvider");
        Intrinsics.checkNotNullParameter(update, "$this$update");
        Intrinsics.checkNotNullParameter(it, "it");
        update.getTileOverlay().remove();
        if (mapApplier != null && (map = mapApplier.getMap()) != null) {
            TileOverlayOptions tileOverlayOptions = new TileOverlayOptions();
            tileOverlayOptions.tileProvider(tileProvider);
            tileOverlayOptions.fadeIn(z);
            tileOverlayOptions.transparency(f);
            tileOverlayOptions.visible(z2);
            tileOverlayOptions.zIndex(f2);
            Unit unit = Unit.INSTANCE;
            TileOverlay tileOverlayAddTileOverlay = map.addTileOverlay(tileOverlayOptions);
            if (tileOverlayAddTileOverlay != null) {
                update.setTileOverlay(tileOverlayAddTileOverlay);
                return Unit.INSTANCE;
            }
        }
        throw new IllegalStateException("Error adding tile overlay".toString());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit TileOverlay$lambda$12$lambda$8(TileOverlayNode update, boolean z) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getTileOverlay().setFadeIn(z);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit TileOverlay$lambda$12$lambda$9(TileOverlayNode update, float f) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getTileOverlay().setTransparency(f);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit TileOverlay$lambda$12$lambda$10(TileOverlayNode update, boolean z) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getTileOverlay().setVisible(z);
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit TileOverlay$lambda$12$lambda$11(TileOverlayNode update, float f) {
        Intrinsics.checkNotNullParameter(update, "$this$update");
        update.getTileOverlay().setZIndex(f);
        return Unit.INSTANCE;
    }

    public static final TileOverlayState rememberTileOverlayState(Composer composer, int i) {
        composer.startReplaceableGroup(1570127269);
        composer.startReplaceableGroup(-533291131);
        Object objRememberedValue = composer.rememberedValue();
        if (objRememberedValue == Composer.INSTANCE.getEmpty()) {
            objRememberedValue = new TileOverlayState();
            composer.updateRememberedValue(objRememberedValue);
        }
        TileOverlayState tileOverlayState = (TileOverlayState) objRememberedValue;
        composer.endReplaceableGroup();
        composer.endReplaceableGroup();
        return tileOverlayState;
    }
}