@charset "UTF-8";

// stylelint-disable scss/dollar-variable-empty-line-before

@use "sass:list";
@use "sass:map";

@mixin backdrop($val...) {
    $backdrop-props: (-webkit-backdrop-filter, backdrop-filter) !default;

    $backdrop-global-values: (inherit, initial, revert, revert-layer, unset, none) !default;

    $backdrop-functions: (
        blur,
        brightness,
        contrast,
        drop-shadow,
        grayscale,
        hue-rotate,
        invert,
        opacity,
        sepia,
        saturate
    ) !default;

    @if meta.type-of($val) == string {
        @if not list.index($backdrop-global-values, $val) {
            @error "$value argument must has one of these values: (#{$backdrop-global-values})";
        }

        @each $prop in $backdrop-props {
            #{$prop}: $val;
        }
    }

    @if meta.type-of($val) == map {
        @each $one-key in map.keys($val) {
            @if not list.index($backdrop-functions, $one-key) {
                @error "#{one-key} is not one of these functions: (#{$backdrop-functions})";
            }
        }

        @debug meta.type-of($val);
        @debug $val;

        $merged: ();

        @each $prop in $backdrop-props {
            @each $key, $actual-val in $val {
                $merged: map.merge(($key, $actual-val), ());
            }
        }
    }
}
