package com.google.maps.android.compose;

import androidx.compose.ui.unit.Density;
import androidx.compose.ui.unit.LayoutDirection;
import com.google.android.gms.maps.GoogleMap;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;

/* JADX INFO: compiled from: MapUpdater.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0016\n\u0002\u0010\u0002\n\u0002\b\u0003\b\u0001\u0018\u00002\u00020\u0001B1\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0005\u0012\b\u0010\u0006\u001a\u0004\u0018\u00010\u0007\u0012\u0006\u0010\b\u001a\u00020\t\u0012\u0006\u0010\n\u001a\u00020\u000b¢\u0006\u0004\b\f\u0010\rJ\b\u0010!\u001a\u00020\"H\u0016J\b\u0010#\u001a\u00020\"H\u0016J\b\u0010$\u001a\u00020\"H\u0016R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u000e\u0010\u000fR\u001a\u0010\b\u001a\u00020\tX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0010\u0010\u0011\"\u0004\b\u0012\u0010\u0013R\u001a\u0010\n\u001a\u00020\u000bX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0014\u0010\u0015\"\u0004\b\u0016\u0010\u0017R(\u0010\u0006\u001a\u0004\u0018\u00010\u00072\b\u0010\u0018\u001a\u0004\u0018\u00010\u0007@FX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0019\u0010\u001a\"\u0004\b\u001b\u0010\u001cR$\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0018\u001a\u00020\u0005@FX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u001d\u0010\u001e\"\u0004\b\u001f\u0010 ¨\u0006%"}, d2 = {"Lcom/google/maps/android/compose/MapPropertiesNode;", "Lcom/google/maps/android/compose/MapNode;", "map", "Lcom/google/android/gms/maps/GoogleMap;", "cameraPositionState", "Lcom/google/maps/android/compose/CameraPositionState;", "contentDescription", "", "density", "Landroidx/compose/ui/unit/Density;", "layoutDirection", "Landroidx/compose/ui/unit/LayoutDirection;", "<init>", "(Lcom/google/android/gms/maps/GoogleMap;Lcom/google/maps/android/compose/CameraPositionState;Ljava/lang/String;Landroidx/compose/ui/unit/Density;Landroidx/compose/ui/unit/LayoutDirection;)V", "getMap", "()Lcom/google/android/gms/maps/GoogleMap;", "getDensity", "()Landroidx/compose/ui/unit/Density;", "setDensity", "(Landroidx/compose/ui/unit/Density;)V", "getLayoutDirection", "()Landroidx/compose/ui/unit/LayoutDirection;", "setLayoutDirection", "(Landroidx/compose/ui/unit/LayoutDirection;)V", "value", "getContentDescription", "()Ljava/lang/String;", "setContentDescription", "(Ljava/lang/String;)V", "getCameraPositionState", "()Lcom/google/maps/android/compose/CameraPositionState;", "setCameraPositionState", "(Lcom/google/maps/android/compose/CameraPositionState;)V", "onAttached", "", "onRemoved", "onCleared", "maps-compose_release"}, k = 1, mv = {2, 0, 0}, xi = 48)
public final class MapPropertiesNode implements MapNode {
    public static final int $stable = 8;
    private CameraPositionState cameraPositionState;
    private String contentDescription;
    private Density density;
    private LayoutDirection layoutDirection;
    private final GoogleMap map;

    public MapPropertiesNode(GoogleMap map, CameraPositionState cameraPositionState, String str, Density density, LayoutDirection layoutDirection) {
        Intrinsics.checkNotNullParameter(map, "map");
        Intrinsics.checkNotNullParameter(cameraPositionState, "cameraPositionState");
        Intrinsics.checkNotNullParameter(density, "density");
        Intrinsics.checkNotNullParameter(layoutDirection, "layoutDirection");
        this.map = map;
        this.density = density;
        this.layoutDirection = layoutDirection;
        cameraPositionState.setMap$maps_compose_release(map);
        if (str != null) {
            map.setContentDescription(str);
        }
        this.contentDescription = str;
        this.cameraPositionState = cameraPositionState;
    }

    public final GoogleMap getMap() {
        return this.map;
    }

    public final Density getDensity() {
        return this.density;
    }

    public final void setDensity(Density density) {
        Intrinsics.checkNotNullParameter(density, "<set-?>");
        this.density = density;
    }

    public final LayoutDirection getLayoutDirection() {
        return this.layoutDirection;
    }

    public final void setLayoutDirection(LayoutDirection layoutDirection) {
        Intrinsics.checkNotNullParameter(layoutDirection, "<set-?>");
        this.layoutDirection = layoutDirection;
    }

    public final String getContentDescription() {
        return this.contentDescription;
    }

    public final void setContentDescription(String str) {
        this.contentDescription = str;
        this.map.setContentDescription(str);
    }

    public final CameraPositionState getCameraPositionState() {
        return this.cameraPositionState;
    }

    public final void setCameraPositionState(CameraPositionState value) {
        Intrinsics.checkNotNullParameter(value, "value");
        if (Intrinsics.areEqual(value, this.cameraPositionState)) {
            return;
        }
        this.cameraPositionState.setMap$maps_compose_release(null);
        this.cameraPositionState = value;
        value.setMap$maps_compose_release(this.map);
    }

    @Override // com.google.maps.android.compose.MapNode
    public void onAttached() {
        this.map.setOnCameraIdleListener(new GoogleMap.OnCameraIdleListener() { // from class: com.google.maps.android.compose.MapPropertiesNode$$ExternalSyntheticLambda0
            @Override // com.google.android.gms.maps.GoogleMap.OnCameraIdleListener
            public final void onCameraIdle() {
                MapPropertiesNode.onAttached$lambda$0(this.f$0);
            }
        });
        this.map.setOnCameraMoveCanceledListener(new GoogleMap.OnCameraMoveCanceledListener() { // from class: com.google.maps.android.compose.MapPropertiesNode$$ExternalSyntheticLambda1
            @Override // com.google.android.gms.maps.GoogleMap.OnCameraMoveCanceledListener
            public final void onCameraMoveCanceled() {
                MapPropertiesNode.onAttached$lambda$1(this.f$0);
            }
        });
        this.map.setOnCameraMoveStartedListener(new GoogleMap.OnCameraMoveStartedListener() { // from class: com.google.maps.android.compose.MapPropertiesNode$$ExternalSyntheticLambda2
            @Override // com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener
            public final void onCameraMoveStarted(int i) {
                MapPropertiesNode.onAttached$lambda$2(this.f$0, i);
            }
        });
        this.map.setOnCameraMoveListener(new GoogleMap.OnCameraMoveListener() { // from class: com.google.maps.android.compose.MapPropertiesNode$$ExternalSyntheticLambda3
            @Override // com.google.android.gms.maps.GoogleMap.OnCameraMoveListener
            public final void onCameraMove() {
                MapPropertiesNode.onAttached$lambda$3(this.f$0);
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void onAttached$lambda$0(MapPropertiesNode this$0) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        this$0.cameraPositionState.setMoving$maps_compose_release(false);
        this$0.cameraPositionState.setRawPosition$maps_compose_release(this$0.map.getCameraPosition());
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void onAttached$lambda$1(MapPropertiesNode this$0) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        this$0.cameraPositionState.setMoving$maps_compose_release(false);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void onAttached$lambda$2(MapPropertiesNode this$0, int i) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        this$0.cameraPositionState.setCameraMoveStartedReason$maps_compose_release(CameraMoveStartedReason.INSTANCE.fromInt(i));
        this$0.cameraPositionState.setMoving$maps_compose_release(true);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void onAttached$lambda$3(MapPropertiesNode this$0) {
        Intrinsics.checkNotNullParameter(this$0, "this$0");
        this$0.cameraPositionState.setRawPosition$maps_compose_release(this$0.map.getCameraPosition());
    }

    @Override // com.google.maps.android.compose.MapNode
    public void onRemoved() {
        this.cameraPositionState.setMap$maps_compose_release(null);
    }

    @Override // com.google.maps.android.compose.MapNode
    public void onCleared() {
        this.cameraPositionState.setMap$maps_compose_release(null);
    }
}