// Divi dependencies.
import { ModuleEditProps } from '@divi/module-library';
import {
	InternalAttrs,
	FormatBreakpointStateAttr,
	type Element,
} from '@divi/types';

import type {
	AttrVal,
	BorderValue,
	TypographyValue,
	SpacingValue,
} from '../custom-types';

type BaseDecoration = Element.Decoration.PickedAttributes<
	| 'animation'
	| 'background'
	| 'border'
	| 'boxShadow'
	| 'disabledOn'
	| 'filters'
	| 'overflow'
	| 'position'
	| 'scroll'
	| 'sizing'
	| 'spacing'
	| 'sticky'
	| 'transform'
	| 'transition'
	| 'zIndex'
	>;

type DecorationExtras = {
	sliderStroke?: FormatBreakpointStateAttr<AttrVal>;
	sliderDefaultColor?: FormatBreakpointStateAttr<AttrVal>;
	sliderRangeColor?: FormatBreakpointStateAttr<AttrVal>;
	pointsWidth?: FormatBreakpointStateAttr<AttrVal>;
	pointsHeight?: FormatBreakpointStateAttr<AttrVal>;
	pointsColor?: FormatBreakpointStateAttr<AttrVal>;
	sliderTrackBorder?: FormatBreakpointStateAttr<BorderValue>;
	rangePointsBorder?: FormatBreakpointStateAttr<BorderValue>;
	valuesTypography?: FormatBreakpointStateAttr<TypographyValue>;
	valuesColor?: FormatBreakpointStateAttr<AttrVal>;
	valuesAlign?: FormatBreakpointStateAttr<AttrVal>;
	valuesSpacing?: FormatBreakpointStateAttr<SpacingValue>;
	inputsWidth?: FormatBreakpointStateAttr<AttrVal>;
	inputsOffset?: FormatBreakpointStateAttr<AttrVal>;
	inputsMargin?: FormatBreakpointStateAttr<SpacingValue>;
	inputsAlignment?: FormatBreakpointStateAttr<AttrVal>;
	inputTypography?: FormatBreakpointStateAttr<TypographyValue>;
	inputColor?: FormatBreakpointStateAttr<AttrVal>;
	inputBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	inputBorder?: FormatBreakpointStateAttr<BorderValue>;
	inputPadding?: FormatBreakpointStateAttr<SpacingValue>;
	inputTextTypography?: FormatBreakpointStateAttr<TypographyValue>;
	inputTextColor?: FormatBreakpointStateAttr<AttrVal>;
	inputTextBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
	inputTextPadding?: FormatBreakpointStateAttr<SpacingValue>;
	labelTypography?: FormatBreakpointStateAttr<TypographyValue>;
	labelAlignment?: FormatBreakpointStateAttr<AttrVal>;
	labelColor?: FormatBreakpointStateAttr<AttrVal>;
	labelSpacing?: FormatBreakpointStateAttr<SpacingValue>;
	labelPadding?: FormatBreakpointStateAttr<SpacingValue>;
	labelMargin?: FormatBreakpointStateAttr<SpacingValue>;
	applyNormalColor?: FormatBreakpointStateAttr<AttrVal>;
	applyNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
	applyHoverColor?: FormatBreakpointStateAttr<AttrVal>;
	applyHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
	applyHoverBorderColor?: FormatBreakpointStateAttr<AttrVal>;
	applyBorder?: FormatBreakpointStateAttr<BorderValue>;
	applySpacing?: FormatBreakpointStateAttr<SpacingValue>;
	applyPadding?: FormatBreakpointStateAttr<SpacingValue>;
	applyMargin?: FormatBreakpointStateAttr<SpacingValue>;
	applyAlignment?: FormatBreakpointStateAttr<AttrVal>;
};

export interface RangeFilterAttrs extends InternalAttrs {
	module?: {
		meta?: Element.Meta.Attributes;
		advanced?: {
			link?: Element.Advanced.Link.Attributes;
			htmlAttributes?: Element.Advanced.IdClasses.Attributes;
			text?: Element.Advanced.Text.Attributes;
		};
		decoration?: BaseDecoration & DecorationExtras;
	};

	[key: string]: any;
}

export type RangeFilterEditProps = ModuleEditProps<RangeFilterAttrs>;
