package com.vinfast.companion.map.extensions;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes4.dex */
@kotlin.Metadata(d1 = {"\u0000*\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\b\u0004\u001a\u001b\u0010\u0004\u001a\u00020\u0003*\u00020\u00002\b\u0010\u0002\u001a\u0004\u0018\u00010\u0001¢\u0006\u0004\b\u0004\u0010\u0005\u001a\u001b\u0010\u0006\u001a\u00020\u0003*\u00020\u00002\b\u0010\u0002\u001a\u0004\u0018\u00010\u0001¢\u0006\u0004\b\u0006\u0010\u0005\u001a\u001b\u0010\t\u001a\u00020\u0003*\u00020\u00002\b\u0010\b\u001a\u0004\u0018\u00010\u0007¢\u0006\u0004\b\t\u0010\n\u001a+\u0010\u000f\u001a\u00020\u0003*\u00020\u000b2\u0018\u0010\u000e\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00000\r\u0012\u0004\u0012\u00020\u00030\f¢\u0006\u0004\b\u000f\u0010\u0010¨\u0006\u0011"}, d2 = {"Lcom/here/sdk/mapview/MapMarker;", "Lcom/here/sdk/mapview/MapScene;", "mapScene", "", "g", "(Lcom/here/sdk/mapview/MapMarker;Lcom/here/sdk/mapview/MapScene;)V", "c", "Lcom/vinfast/companion/map/model/MapLocation;", "mapLocation", "h", "(Lcom/here/sdk/mapview/MapMarker;Lcom/vinfast/companion/map/model/MapLocation;)V", "Lcom/here/sdk/mapview/MapView;", "Lkotlin/Function1;", "", "onMarkerTap", "d", "(Lcom/here/sdk/mapview/MapView;Lkotlin/jvm/functions/Function1;)V", "hereSdk_release"}, k = 2, mv = {2, 2, 0}, xi = 48)
@kotlin.jvm.internal.SourceDebugExtension
public final class MapMarkerExtensionsKt {
    public static final void c(com.here.sdk.mapview.MapMarker mapMarker, com.here.sdk.mapview.MapScene mapScene) {
        kotlin.jvm.internal.Intrinsics.l(mapMarker, "<this>");
        if (mapScene != null) {
            mapScene.removeMapMarker(mapMarker);
        }
    }

    public static final void d(final com.here.sdk.mapview.MapView mapView, final kotlin.jvm.functions.Function1 function1) {
        kotlin.jvm.internal.Intrinsics.l(mapView, "<this>");
        kotlin.jvm.internal.Intrinsics.l(function1, "onMarkerTap");
        final com.here.sdk.mapview.MapViewBase.MapPickCallback mapPickCallback = new com.here.sdk.mapview.MapViewBase.MapPickCallback() { // from class: com.vinfast.companion.map.extensions.a
            public final void onPickMap(com.here.sdk.mapview.MapPickResult mapPickResult) {
                com.vinfast.companion.map.extensions.MapMarkerExtensionsKt.e(mapView, function1, mapPickResult);
            }
        };
        mapView.getGestures().setTapListener(new com.here.sdk.gestures.TapListener() { // from class: com.vinfast.companion.map.extensions.b
            public final void onTap(com.here.sdk.core.Point2D point2D) {
                com.vinfast.companion.map.extensions.MapMarkerExtensionsKt.f(mapView, mapPickCallback, point2D);
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void e(com.here.sdk.mapview.MapView mapView, kotlin.jvm.functions.Function1 function1, com.here.sdk.mapview.MapPickResult mapPickResult) {
        com.here.sdk.mapview.PickMapItemsResult mapItems;
        java.util.List markers;
        if (mapPickResult == null || (mapItems = mapPickResult.getMapItems()) == null || (markers = mapItems.getMarkers()) == null) {
            function1.invoke(kotlin.collections.CollectionsKt.o());
        } else {
            function1.invoke(markers);
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void f(com.here.sdk.mapview.MapView mapView, com.here.sdk.mapview.MapViewBase.MapPickCallback mapPickCallback, com.here.sdk.core.Point2D point2D) {
        kotlin.jvm.internal.Intrinsics.l(point2D, "touchPoint");
        mapView.pick((com.here.sdk.mapview.MapScene.MapPickFilter) null, new com.here.sdk.core.Rectangle2D(new com.here.sdk.core.Point2D(point2D.x, point2D.y), new com.here.sdk.core.Size2D(1.0d, 1.0d)), mapPickCallback);
    }

    public static final void g(com.here.sdk.mapview.MapMarker mapMarker, com.here.sdk.mapview.MapScene mapScene) {
        kotlin.jvm.internal.Intrinsics.l(mapMarker, "<this>");
        if (mapScene != null) {
            mapScene.addMapMarker(mapMarker);
        }
    }

    public static final void h(com.here.sdk.mapview.MapMarker mapMarker, com.vinfast.companion.map.model.MapLocation mapLocation) {
        com.here.sdk.core.GeoCoordinates geoCoordinatesL;
        kotlin.jvm.internal.Intrinsics.l(mapMarker, "<this>");
        if (mapLocation == null || (geoCoordinatesL = mapLocation.l()) == null) {
            return;
        }
        mapMarker.setCoordinates(geoCoordinatesL);
    }
}
