package com.sistemasolton.itranvias;

import android.app.Activity;
import android.content.Context;
import android.view.View;
import android.view.Window;
import androidx.compose.material3.MaterialTheme;
import androidx.compose.runtime.Composer;
import androidx.compose.runtime.ComposerKt;
import androidx.compose.runtime.EffectsKt;
import androidx.compose.runtime.ProvidableCompositionLocal;
import androidx.compose.runtime.RecomposeScopeImplKt;
import androidx.compose.runtime.ScopeUpdateScope;
import androidx.compose.ui.graphics.ColorKt;
import androidx.compose.ui.platform.AndroidCompositionLocals_androidKt;
import androidx.core.view.WindowCompat;
import androidx.core.view.WindowInsetsControllerCompat;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.Intrinsics;

/* JADX INFO: compiled from: SystemBarsColors.android.kt */
/* JADX INFO: loaded from: classes2.dex */
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\u001a\u0015\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\u0007¢\u0006\u0002\u0010\u0004¨\u0006\u0005"}, d2 = {"SystemBarsColors", "", "darkTheme", "", "(ZLandroidx/compose/runtime/Composer;I)V", "composeApp_release"}, k = 2, mv = {2, 1, 0}, xi = 48)
public final class SystemBarsColors_androidKt {
    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit SystemBarsColors$lambda$3(boolean z, int i, Composer composer, int i2) {
        SystemBarsColors(z, composer, RecomposeScopeImplKt.updateChangedFlags(i | 1));
        return Unit.INSTANCE;
    }

    public static final void SystemBarsColors(final boolean z, Composer composer, final int i) {
        Composer composerStartRestartGroup = composer.startRestartGroup(-574355358);
        if ((i & 1) != 0 || !composerStartRestartGroup.getSkipping()) {
            if (ComposerKt.isTraceInProgress()) {
                ComposerKt.traceEventStart(-574355358, i, -1, "com.sistemasolton.itranvias.SystemBarsColors (SystemBarsColors.android.kt:10)");
            }
            ProvidableCompositionLocal<View> localView = AndroidCompositionLocals_androidKt.getLocalView();
            ComposerKt.sourceInformationMarkerStart(composerStartRestartGroup, 2023513938, "CC(<get-current>):CompositionLocal.kt#9igjgp");
            Object objConsume = composerStartRestartGroup.consume(localView);
            ComposerKt.sourceInformationMarkerEnd(composerStartRestartGroup);
            final View view = (View) objConsume;
            if (!view.isInEditMode()) {
                Context context = view.getContext();
                Activity activity = context instanceof Activity ? (Activity) context : null;
                final Window window = activity != null ? activity.getWindow() : null;
                final long jM2005getInversePrimary0d7_KjU = MaterialTheme.INSTANCE.getColorScheme(composerStartRestartGroup, MaterialTheme.$stable).getInversePrimary();
                composerStartRestartGroup.startReplaceGroup(-1746271574);
                boolean zChangedInstance = composerStartRestartGroup.changedInstance(window) | composerStartRestartGroup.changed(jM2005getInversePrimary0d7_KjU) | composerStartRestartGroup.changedInstance(view);
                Object objRememberedValue = composerStartRestartGroup.rememberedValue();
                if (zChangedInstance || objRememberedValue == Composer.INSTANCE.getEmpty()) {
                    objRememberedValue = new Function0() { // from class: com.sistemasolton.itranvias.SystemBarsColors_androidKt$$ExternalSyntheticLambda0
                        @Override // kotlin.jvm.functions.Function0
                        public final Object invoke() {
                            return SystemBarsColors_androidKt.SystemBarsColors$lambda$2$lambda$1(window, jM2005getInversePrimary0d7_KjU, view);
                        }
                    };
                    composerStartRestartGroup.updateRememberedValue(objRememberedValue);
                }
                composerStartRestartGroup.endReplaceGroup();
                EffectsKt.SideEffect((Function0) objRememberedValue, composerStartRestartGroup, 0);
            }
            if (ComposerKt.isTraceInProgress()) {
                ComposerKt.traceEventEnd();
            }
        } else {
            composerStartRestartGroup.skipToGroupEnd();
        }
        ScopeUpdateScope scopeUpdateScopeEndRestartGroup = composerStartRestartGroup.endRestartGroup();
        if (scopeUpdateScopeEndRestartGroup != null) {
            scopeUpdateScopeEndRestartGroup.updateScope(new Function2() { // from class: com.sistemasolton.itranvias.SystemBarsColors_androidKt$$ExternalSyntheticLambda1
                @Override // kotlin.jvm.functions.Function2
                public final Object invoke(Object obj, Object obj2) {
                    return SystemBarsColors_androidKt.SystemBarsColors$lambda$3(z, i, (Composer) obj, ((Integer) obj2).intValue());
                }
            });
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final Unit SystemBarsColors$lambda$2$lambda$1(Window window, long j, View view) {
        if (window != null) {
            window.setStatusBarColor(ColorKt.m4555toArgb8_81llA(j));
            window.setNavigationBarColor(ColorKt.m4555toArgb8_81llA(j));
            WindowInsetsControllerCompat insetsController = WindowCompat.getInsetsController(window, view);
            Intrinsics.checkNotNullExpressionValue(insetsController, "getInsetsController(...)");
            insetsController.setAppearanceLightStatusBars(false);
            insetsController.setAppearanceLightNavigationBars(false);
        }
        return Unit.INSTANCE;
    }
}