package com.google.maps.android.compose;

import android.location.Location;
import androidx.compose.runtime.Applier;
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.common.internal.ServiceSpecificExtraArgs;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.IndoorBuilding;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.PointOfInterest;
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;
import kotlin.jvm.internal.MutablePropertyReference0Impl;
import kotlin.reflect.KMutableProperty0;

/* JADX INFO: compiled from: MapClickListeners.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000.\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\r\u0010\u0000\u001a\u00020\u0001H\u0001¢\u0006\u0002\u0010\u0002\u001aP\u0010\u0003\u001a\u00020\u0001\"\b\b\u0000\u0010\u0004*\u00020\u00052\u000e\u0010\u0006\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00050\u00072\u001f\u0010\b\u001a\u001b\u0012\u0004\u0012\u00020\n\u0012\u0006\u0012\u0004\u0018\u0001H\u0004\u0012\u0004\u0012\u00020\u00010\t¢\u0006\u0002\b\u000b2\u0006\u0010\f\u001a\u0002H\u0004H\u0003¢\u0006\u0002\u0010\r\u001a/\u0010\u0003\u001a\u00020\u00012\u000e\u0010\u0006\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00050\u00072\u0010\u0010\u000e\u001a\f\u0012\b\u0012\u0006\u0012\u0002\b\u00030\u000f0\u0007H\u0003¢\u0006\u0002\u0010\u0010¨\u0006\u0011"}, d2 = {"MapClickListenerUpdater", "", "(Landroidx/compose/runtime/Composer;I)V", "MapClickListenerComposeNode", "L", "", "callback", "Lkotlin/Function0;", "setter", "Lkotlin/Function2;", "Lcom/google/android/gms/maps/GoogleMap;", "Lkotlin/ExtensionFunctionType;", ServiceSpecificExtraArgs.CastExtraArgs.LISTENER, "(Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Landroidx/compose/runtime/Composer;I)V", "factory", "Lcom/google/maps/android/compose/MapClickListenerNode;", "(Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function0;Landroidx/compose/runtime/Composer;I)V", "maps-compose_release"}, k = 2, mv = {2, 0, 0}, xi = 48)
public final class MapClickListenersKt {
    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit MapClickListenerComposeNode$lambda$17(Function0 callback, Function0 factory, int i, Composer composer, int i2) {
        Intrinsics.checkNotNullParameter(callback, "$callback");
        Intrinsics.checkNotNullParameter(factory, "$factory");
        MapClickListenerComposeNode(callback, factory, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit MapClickListenerUpdater$lambda$14(int i, Composer composer, int i2) {
        MapClickListenerUpdater(composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    public static final void MapClickListenerUpdater(Composer composer, final int i) {
        Composer composerStartRestartGroup = composer.startRestartGroup(1792062778);
        if (i != 0 || !composerStartRestartGroup.getSkipping()) {
            Applier<?> applier = composerStartRestartGroup.getApplier();
            Intrinsics.checkNotNull(applier, "null cannot be cast to non-null type com.google.maps.android.compose.MapApplier");
            final MapClickListeners mapClickListeners = ((MapApplier) applier).getMapClickListeners();
            composerStartRestartGroup.startReplaceableGroup(1577826274);
            final MutablePropertyReference0Impl mutablePropertyReference0Impl = new MutablePropertyReference0Impl(mapClickListeners) { // from class: com.google.maps.android.compose.MapClickListenersKt$MapClickListenerUpdater$1$1
                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KProperty0
                public Object get() {
                    return ((MapClickListeners) this.receiver).getIndoorStateChangeListener();
                }

                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KMutableProperty0
                public void set(Object obj) {
                    ((MapClickListeners) this.receiver).setIndoorStateChangeListener((IndoorStateChangeListener) obj);
                }
            };
            MapClickListenerComposeNode(mutablePropertyReference0Impl, MapClickListenersKt$MapClickListenerUpdater$1$2$1.INSTANCE, new GoogleMap.OnIndoorStateChangeListener() { // from class: com.google.maps.android.compose.MapClickListenersKt$MapClickListenerUpdater$1$2$2
                @Override // com.google.android.gms.maps.GoogleMap.OnIndoorStateChangeListener
                public void onIndoorBuildingFocused() {
                    mutablePropertyReference0Impl.invoke().onIndoorBuildingFocused();
                }

                @Override // com.google.android.gms.maps.GoogleMap.OnIndoorStateChangeListener
                public void onIndoorLevelActivated(IndoorBuilding building) {
                    Intrinsics.checkNotNullParameter(building, "building");
                    mutablePropertyReference0Impl.invoke().onIndoorLevelActivated(building);
                }
            }, composerStartRestartGroup, 8);
            composerStartRestartGroup.endReplaceableGroup();
            composerStartRestartGroup.startReplaceableGroup(1577843195);
            final MutablePropertyReference0Impl mutablePropertyReference0Impl2 = new MutablePropertyReference0Impl(mapClickListeners) { // from class: com.google.maps.android.compose.MapClickListenersKt$MapClickListenerUpdater$1$3
                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KProperty0
                public Object get() {
                    return ((MapClickListeners) this.receiver).getOnMapClick();
                }

                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KMutableProperty0
                public void set(Object obj) {
                    ((MapClickListeners) this.receiver).setOnMapClick((Function1) obj);
                }
            };
            MapClickListenerComposeNode(mutablePropertyReference0Impl2, MapClickListenersKt$MapClickListenerUpdater$1$4$1.INSTANCE, new GoogleMap.OnMapClickListener() { // from class: com.google.maps.android.compose.MapClickListenersKt$$ExternalSyntheticLambda1
                @Override // com.google.android.gms.maps.GoogleMap.OnMapClickListener
                public final void onMapClick(LatLng latLng) {
                    MapClickListenersKt.MapClickListenerUpdater$lambda$13$lambda$2$lambda$1(mutablePropertyReference0Impl2, latLng);
                }
            }, composerStartRestartGroup, 520);
            composerStartRestartGroup.endReplaceableGroup();
            composerStartRestartGroup.startReplaceableGroup(1577851107);
            final MutablePropertyReference0Impl mutablePropertyReference0Impl3 = new MutablePropertyReference0Impl(mapClickListeners) { // from class: com.google.maps.android.compose.MapClickListenersKt$MapClickListenerUpdater$1$5
                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KProperty0
                public Object get() {
                    return ((MapClickListeners) this.receiver).getOnMapLongClick();
                }

                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KMutableProperty0
                public void set(Object obj) {
                    ((MapClickListeners) this.receiver).setOnMapLongClick((Function1) obj);
                }
            };
            MapClickListenerComposeNode(mutablePropertyReference0Impl3, MapClickListenersKt$MapClickListenerUpdater$1$6$1.INSTANCE, new GoogleMap.OnMapLongClickListener() { // from class: com.google.maps.android.compose.MapClickListenersKt$$ExternalSyntheticLambda2
                @Override // com.google.android.gms.maps.GoogleMap.OnMapLongClickListener
                public final void onMapLongClick(LatLng latLng) {
                    MapClickListenersKt.MapClickListenerUpdater$lambda$13$lambda$4$lambda$3(mutablePropertyReference0Impl3, latLng);
                }
            }, composerStartRestartGroup, 520);
            composerStartRestartGroup.endReplaceableGroup();
            composerStartRestartGroup.startReplaceableGroup(1577859163);
            final MutablePropertyReference0Impl mutablePropertyReference0Impl4 = new MutablePropertyReference0Impl(mapClickListeners) { // from class: com.google.maps.android.compose.MapClickListenersKt$MapClickListenerUpdater$1$7
                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KProperty0
                public Object get() {
                    return ((MapClickListeners) this.receiver).getOnMapLoaded();
                }

                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KMutableProperty0
                public void set(Object obj) {
                    ((MapClickListeners) this.receiver).setOnMapLoaded((Function0) obj);
                }
            };
            MapClickListenerComposeNode(mutablePropertyReference0Impl4, MapClickListenersKt$MapClickListenerUpdater$1$8$1.INSTANCE, new GoogleMap.OnMapLoadedCallback() { // from class: com.google.maps.android.compose.MapClickListenersKt$$ExternalSyntheticLambda3
                @Override // com.google.android.gms.maps.GoogleMap.OnMapLoadedCallback
                public final void onMapLoaded() {
                    MapClickListenersKt.MapClickListenerUpdater$lambda$13$lambda$6$lambda$5(mutablePropertyReference0Impl4);
                }
            }, composerStartRestartGroup, 520);
            composerStartRestartGroup.endReplaceableGroup();
            composerStartRestartGroup.startReplaceableGroup(1577867388);
            final MutablePropertyReference0Impl mutablePropertyReference0Impl5 = new MutablePropertyReference0Impl(mapClickListeners) { // from class: com.google.maps.android.compose.MapClickListenersKt$MapClickListenerUpdater$1$9
                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KProperty0
                public Object get() {
                    return ((MapClickListeners) this.receiver).getOnMyLocationButtonClick();
                }

                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KMutableProperty0
                public void set(Object obj) {
                    ((MapClickListeners) this.receiver).setOnMyLocationButtonClick((Function0) obj);
                }
            };
            MapClickListenerComposeNode(mutablePropertyReference0Impl5, MapClickListenersKt$MapClickListenerUpdater$1$10$1.INSTANCE, new GoogleMap.OnMyLocationButtonClickListener() { // from class: com.google.maps.android.compose.MapClickListenersKt$$ExternalSyntheticLambda4
                @Override // com.google.android.gms.maps.GoogleMap.OnMyLocationButtonClickListener
                public final boolean onMyLocationButtonClick() {
                    return MapClickListenersKt.MapClickListenerUpdater$lambda$13$lambda$8$lambda$7(mutablePropertyReference0Impl5);
                }
            }, composerStartRestartGroup, 520);
            composerStartRestartGroup.endReplaceableGroup();
            composerStartRestartGroup.startReplaceableGroup(1577876425);
            final MutablePropertyReference0Impl mutablePropertyReference0Impl6 = new MutablePropertyReference0Impl(mapClickListeners) { // from class: com.google.maps.android.compose.MapClickListenersKt$MapClickListenerUpdater$1$11
                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KProperty0
                public Object get() {
                    return ((MapClickListeners) this.receiver).getOnMyLocationClick();
                }

                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KMutableProperty0
                public void set(Object obj) {
                    ((MapClickListeners) this.receiver).setOnMyLocationClick((Function1) obj);
                }
            };
            MapClickListenerComposeNode(mutablePropertyReference0Impl6, MapClickListenersKt$MapClickListenerUpdater$1$12$1.INSTANCE, new GoogleMap.OnMyLocationClickListener() { // from class: com.google.maps.android.compose.MapClickListenersKt$$ExternalSyntheticLambda5
                @Override // com.google.android.gms.maps.GoogleMap.OnMyLocationClickListener
                public final void onMyLocationClick(Location location) {
                    MapClickListenersKt.MapClickListenerUpdater$lambda$13$lambda$10$lambda$9(mutablePropertyReference0Impl6, location);
                }
            }, composerStartRestartGroup, 520);
            composerStartRestartGroup.endReplaceableGroup();
            composerStartRestartGroup.startReplaceableGroup(1577884635);
            final MutablePropertyReference0Impl mutablePropertyReference0Impl7 = new MutablePropertyReference0Impl(mapClickListeners) { // from class: com.google.maps.android.compose.MapClickListenersKt$MapClickListenerUpdater$1$13
                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KProperty0
                public Object get() {
                    return ((MapClickListeners) this.receiver).getOnPOIClick();
                }

                @Override // kotlin.jvm.internal.MutablePropertyReference0Impl, kotlin.reflect.KMutableProperty0
                public void set(Object obj) {
                    ((MapClickListeners) this.receiver).setOnPOIClick((Function1) obj);
                }
            };
            MapClickListenerComposeNode(mutablePropertyReference0Impl7, MapClickListenersKt$MapClickListenerUpdater$1$14$1.INSTANCE, new GoogleMap.OnPoiClickListener() { // from class: com.google.maps.android.compose.MapClickListenersKt$$ExternalSyntheticLambda6
                @Override // com.google.android.gms.maps.GoogleMap.OnPoiClickListener
                public final void onPoiClick(PointOfInterest pointOfInterest) {
                    MapClickListenersKt.MapClickListenerUpdater$lambda$13$lambda$12$lambda$11(mutablePropertyReference0Impl7, pointOfInterest);
                }
            }, composerStartRestartGroup, 520);
            composerStartRestartGroup.endReplaceableGroup();
        } else {
            composerStartRestartGroup.skipToGroupEnd();
        }
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.MapClickListenersKt$$ExternalSyntheticLambda7
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return MapClickListenersKt.MapClickListenerUpdater$lambda$14(i, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void MapClickListenerUpdater$lambda$13$lambda$2$lambda$1(KMutableProperty0 callback, LatLng it) {
        Intrinsics.checkNotNullParameter(callback, "$callback");
        Intrinsics.checkNotNullParameter(it, "it");
        Function1 function1 = (Function1) callback.invoke();
        if (function1 != null) {
            function1.invoke(it);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void MapClickListenerUpdater$lambda$13$lambda$4$lambda$3(KMutableProperty0 callback, LatLng it) {
        Intrinsics.checkNotNullParameter(callback, "$callback");
        Intrinsics.checkNotNullParameter(it, "it");
        Function1 function1 = (Function1) callback.invoke();
        if (function1 != null) {
            function1.invoke(it);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void MapClickListenerUpdater$lambda$13$lambda$6$lambda$5(KMutableProperty0 callback) {
        Intrinsics.checkNotNullParameter(callback, "$callback");
        Function0 function0 = (Function0) callback.invoke();
        if (function0 != null) {
            function0.invoke();
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final boolean MapClickListenerUpdater$lambda$13$lambda$8$lambda$7(KMutableProperty0 callback) {
        Intrinsics.checkNotNullParameter(callback, "$callback");
        Function0 function0 = (Function0) callback.invoke();
        if (function0 != null) {
            return ((Boolean) function0.invoke()).booleanValue();
        }
        return false;
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void MapClickListenerUpdater$lambda$13$lambda$10$lambda$9(KMutableProperty0 callback, Location it) {
        Intrinsics.checkNotNullParameter(callback, "$callback");
        Intrinsics.checkNotNullParameter(it, "it");
        Function1 function1 = (Function1) callback.invoke();
        if (function1 != null) {
            function1.invoke(it);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void MapClickListenerUpdater$lambda$13$lambda$12$lambda$11(KMutableProperty0 callback, PointOfInterest it) {
        Intrinsics.checkNotNullParameter(callback, "$callback");
        Intrinsics.checkNotNullParameter(it, "it");
        Function1 function1 = (Function1) callback.invoke();
        if (function1 != null) {
            function1.invoke(it);
        }
    }

    private static final <L> void MapClickListenerComposeNode(Function0<? extends Object> function0, final Function2<? super GoogleMap, ? super L, Unit> function2, final L l, Composer composer, int i) {
        composer.startReplaceableGroup(-649632125);
        Applier<?> applier = composer.getApplier();
        Intrinsics.checkNotNull(applier, "null cannot be cast to non-null type com.google.maps.android.compose.MapApplier");
        final MapApplier mapApplier = (MapApplier) applier;
        MapClickListenerComposeNode(function0, new Function0() { // from class: com.google.maps.android.compose.MapClickListenersKt$$ExternalSyntheticLambda8
            @Override // kotlin.jvm.functions.Function0
            public final Object invoke() {
                return MapClickListenersKt.MapClickListenerComposeNode$lambda$15(mapApplier, function2, l);
            }
        }, composer, i & 14);
        composer.endReplaceableGroup();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final MapClickListenerNode MapClickListenerComposeNode$lambda$15(MapApplier mapApplier, Function2 setter, Object listener) {
        Intrinsics.checkNotNullParameter(mapApplier, "$mapApplier");
        Intrinsics.checkNotNullParameter(setter, "$setter");
        Intrinsics.checkNotNullParameter(listener, "$listener");
        return new MapClickListenerNode(mapApplier.getMap(), setter, listener);
    }

    private static final void MapClickListenerComposeNode(final Function0<? extends Object> function0, final Function0<? extends MapClickListenerNode<?>> function02, Composer composer, final int i) {
        int i2;
        Composer composerStartRestartGroup = composer.startRestartGroup(-1042600347);
        if ((i & 14) == 0) {
            i2 = (composerStartRestartGroup.changedInstance(function0) ? 4 : 2) | i;
        } else {
            i2 = i;
        }
        if ((i & 112) == 0) {
            i2 |= composerStartRestartGroup.changedInstance(function02) ? 32 : 16;
        }
        if ((i2 & 91) != 18 || !composerStartRestartGroup.getSkipping()) {
            if (function0.invoke() != null) {
                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<MapClickListenerNode<?>>() { // from class: com.google.maps.android.compose.MapClickListenersKt$MapClickListenerComposeNode$$inlined$ComposeNode$1
                        {
                            super(0);
                        }

                        /* JADX WARN: Type inference failed for: r0v1, types: [com.google.maps.android.compose.MapClickListenerNode<?>, java.lang.Object] */
                        @Override // kotlin.jvm.functions.Function0
                        public final MapClickListenerNode<?> invoke() {
                            return function02.invoke();
                        }
                    });
                } else {
                    composerStartRestartGroup.useNode();
                }
                Updater.m3820constructorimpl(composerStartRestartGroup);
                composerStartRestartGroup.endNode();
                composerStartRestartGroup.endReplaceableGroup();
            }
        } else {
            composerStartRestartGroup.skipToGroupEnd();
        }
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.google.maps.android.compose.MapClickListenersKt$$ExternalSyntheticLambda0
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return MapClickListenersKt.MapClickListenerComposeNode$lambda$17(function0, function02, i, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }
}