// Divi dependencies.
import { ModuleEditProps } from '@divi/module-library';
import {
	InternalAttrs,
	type Element, FormatBreakpointStateAttr,
} 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 = {
    contentPosition?: FormatBreakpointStateAttr<AttrVal>;
    contentLineAlignment?: FormatBreakpointStateAttr<AttrVal>;
    contentBlockAlignment?: FormatBreakpointStateAttr<AttrVal>;

    inputWidth?: FormatBreakpointStateAttr<AttrVal>;
    inputTypography?: FormatBreakpointStateAttr<TypographyValue>;
    inputColor?: FormatBreakpointStateAttr<AttrVal>;
    inputBackgroundColor?: FormatBreakpointStateAttr<AttrVal>;
    inputBorder?: FormatBreakpointStateAttr<BorderValue>;
    inputSpacing?: FormatBreakpointStateAttr<SpacingValue>;

    calendarTypography?: FormatBreakpointStateAttr<TypographyValue>;
    calendarVerOffset?: FormatBreakpointStateAttr<AttrVal>;
    calendarHorOffset?: FormatBreakpointStateAttr<AttrVal>;
    calendarWidth?: FormatBreakpointStateAttr<AttrVal>;
    calendarBgColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarBorder?: FormatBreakpointStateAttr<BorderValue>;
    calendarSpacing?: FormatBreakpointStateAttr<SpacingValue>;

    calendarCaptionColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarCaptionTypography?: FormatBreakpointStateAttr<TypographyValue>;

    calendarPrevNextSize?: FormatBreakpointStateAttr<AttrVal>;
    calendarPrevNextNormalColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarPrevNextHoverColor?: FormatBreakpointStateAttr<AttrVal>;

    calendarWeekHeaderBorder?: FormatBreakpointStateAttr<BorderValue>;
    calendarWeekHeaderBgColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarWeekDayPadding?: FormatBreakpointStateAttr<SpacingValue>;
    calendarWeekDayBorder?: FormatBreakpointStateAttr<BorderValue>;
    calendarWeekDayTypography?: FormatBreakpointStateAttr<TypographyValue>;
    calendarWeekDayColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarWeekDayBgColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarWeekDayContentBorder?: FormatBreakpointStateAttr<BorderValue>;
    calendarWeekDayContentPadding?: FormatBreakpointStateAttr<SpacingValue>;

    calendarDaysBorder?: FormatBreakpointStateAttr<BorderValue>;
    calendarDaysBgColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayPadding?: FormatBreakpointStateAttr<SpacingValue>;
    calendarDayBorder?: FormatBreakpointStateAttr<BorderValue>;
    calendarDayTypography?: FormatBreakpointStateAttr<TypographyValue>;
    calendarDayDefaultColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayDefaultBgColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayHoverColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayHoverBorderColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayActiveColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayActiveBgColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayActiveBorderColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayCurrentColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayCurrentBgColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayCurrentBorderColor?: FormatBreakpointStateAttr<AttrVal>;
    calendarDayContentBorder?: FormatBreakpointStateAttr<BorderValue>;
    calendarDayContentPadding?: FormatBreakpointStateAttr<SpacingValue>;

    labelTypography?: FormatBreakpointStateAttr<TypographyValue>;
    labelAlignment?: FormatBreakpointStateAttr<AttrVal>;
    labelColor?: FormatBreakpointStateAttr<AttrVal>;
    labelGapY?: FormatBreakpointStateAttr<AttrVal>;

    applyTypography?: FormatBreakpointStateAttr<TypographyValue>;
    applyNormalColor?: FormatBreakpointStateAttr<AttrVal>;
    applyNormalBgColor?: FormatBreakpointStateAttr<AttrVal>;
    applyHoverColor?: FormatBreakpointStateAttr<AttrVal>;
    applyHoverBgColor?: FormatBreakpointStateAttr<AttrVal>;
    applyHoverBorderColor?: FormatBreakpointStateAttr<AttrVal>;
    applyBorder?: FormatBreakpointStateAttr<BorderValue>;
    applyAlignment?: FormatBreakpointStateAttr<AttrVal>;
    applySpacing?: FormatBreakpointStateAttr<SpacingValue>;
};

export interface DateRangeFilterAttrs 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 DateRangeFilterEditProps = ModuleEditProps<DateRangeFilterAttrs>;
