// #region Imports
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var DateTimeBoxElement_1;
import { Key } from '../../../../Controls/Types/Key';
import { DomServiceLocator } from '../../../../Dom/Dom';
import { isDate } from '../../../../Extensions/Extensions';
import { DateParser } from '../../../../Intl/DateParser';
import { DateTimeFormatter } from '../../../../Intl/Formatters/DateTimeFormatter';
import { Appearanceable } from '../../../Behaviors/Appearanceable';
import { Clearable } from '../../../Behaviors/Clearable';
import { Disableable } from '../../../Behaviors/Disableable';
import { DropDownable } from '../../../Behaviors/DropDownable';
import { Invalidable } from '../../../Behaviors/Invalidable';
import { Labelable } from '../../../Behaviors/Labelable';
import { Localeable } from '../../../Behaviors/Localeable';
import { Slottable } from '../../../Behaviors/Slottable';
import { Valueable } from '../../../Behaviors/Valueable';
import { Variantable } from '../../../Behaviors/Variantable';
import { ClickOutsideController } from '../../../Controllers/ClickOutsideController';
import { KeyboardController } from '../../../Controllers/KeyboardController';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { QueryChild } from '../../../Decorators/QueryChildDecorator';
import { Watch } from '../../../Decorators/WatchDecorator';
import { CalendarView } from '../../../Types/CalendarView';
import { DayOfWeek } from '../../../Types/DayOfWeek';
import { IconElement } from '../../Media/Icon/IconElement';
import { FloatingElement } from '../../Primitives/Floating/FloatingElement';
import { FocusRingElement } from '../../Primitives/FocusRing/FocusRingElement';
import { PopupElement } from '../../Primitives/Popup/PopupElement';
import { InputBaseElement } from '../Abstracts/InputBase';
import { CalendarElement } from '../Calendar/CalendarElement';
import { getDateOnly } from '../Calendar/Utils';
import { dateTimeBoxElementTemplate } from './DateTimeBoxElementTemplate';
import { dateTimeBoxElementJoyStyle } from './Themes/DateTimeBoxElement.Joy';
import { dateTimeBoxElementRetroStyle } from './Themes/DateTimeBoxElement.Retro';
import { dateTimeBoxElementCosmopolitanStyle } from './Themes/DateTimeBoxElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
import { TextAlignment } from '../../../Types/TextAlignment';
import { PortalElement } from '../../Primitives/Portal/PortalElement';
import { ProjectionController } from '../../Primitives/Portal/ProjectionController';
// #endregion
/**
 * Date Time Box - A user interface component for selecting date and time values.
 *
 * @element mosaik-datetimebox
 *
 * @description
 * The Datetime Box component allows users to select both date and time values.
 * It provides a user-friendly interface for choosing dates using a calendar picker and time using dropdowns or input fields.
 * Datetime boxes are commonly used in scheduling applications, forms, and event planners.
 *
 * @category Forms
 *
 * @keyhandle Space - Toggles the dropdown.
 * @keyhandle Enter - Toggles the dropdown.
 * @keyhandle Escape - Closes the dropdown if it is open, otherwise clears the value.
 * @keyhandle Tab - Closes the dropdown.
 *
 * @example
 * ```html
 * <mosaik-datetimebox></mosaik-datetimebox>
 * ```
 *
 * @public
 */
let DateTimeBoxElement = DateTimeBoxElement_1 = class DateTimeBoxElement extends Themeable(Slottable(Clearable(Localeable(Disableable(Invalidable(Valueable(Variantable(Appearanceable(DropDownable(Labelable(InputBaseElement))))))))))) {
    // #region Fields
    _inputElement;
    _clickOutsideController;
    _keyboardController;
    _projectionController;
    _value;
    _displayValue;
    _readonly;
    _required;
    _autofocus;
    _name;
    _placeholder;
    _autocomplete;
    _values;
    _view;
    _blackoutDates;
    _specialDates;
    _minDate;
    _maxDate;
    _firstDayOfWeek;
    _isTodayHighlighted;
    _isWeekendHighlighted;
    _showWeekNumbers;
    _markerHandler;
    _showAdjacent;
    _format;
    _invalidInput;
    _textAlign;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        // REMARK: This is a workaround for the issue with the docs generation.
        Object.assign(this, { maxDropDownHeight: 'auto' });
        this._value = new Date();
        this._displayValue = '';
        this._readonly = false;
        this._required = false;
        this._autofocus = false;
        this._name = '';
        this._placeholder = '';
        this._autocomplete = false;
        this._values = new Array();
        this._view = CalendarView.Day;
        this._blackoutDates = new Array();
        this._specialDates = new Array();
        this._minDate = null;
        this._maxDate = null;
        this._firstDayOfWeek = DayOfWeek.Sunday;
        this._isTodayHighlighted = false;
        this._isWeekendHighlighted = false;
        this._showWeekNumbers = false;
        this._markerHandler = (_item) => [];
        this._showAdjacent = false;
        this._format = 'yyyy-MM-dd HH:mm:ss';
        this._invalidInput = false;
        this._textAlign = TextAlignment.Right;
        this._clickOutsideController = new ClickOutsideController(this, {
            skipInitial: true,
            callback: () => this.close()
        });
        this._keyboardController = new KeyboardController(this);
        this._projectionController = new ProjectionController(this, {
            slotName: '',
            targetSelector: '[part="projection"]',
            projecting: (element) => {
                element.setAttribute(`${DateTimeBoxElement_1.is}-projection`, '');
            }
        });
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `{@link is}` property.
     * The `{@link is}` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-datetimebox';
    }
    /**
     * Returns the `displayDate` property.
     * The `displayDate` property represents the initial date to display in the calendar.
     *
     * @public
     */
    get displayDate() {
        return this.value;
    }
    set displayDate(value) {
        this.value = value;
    }
    /**
     * Returns the `displayDateStart` property.
     * The `displayDateStart` property represents the start date to display in the calendar.
     *
     * @public
     */
    get displayDateStart() {
        return this._value;
    }
    set displayDateStart(value) {
        this._value = value;
    }
    /**
     * Returns the `displayDateEnd` property.
     * The `displayDateEnd` property represents the end date to display in the calendar.
     *
     * @public
     */
    get displayDateEnd() {
        return this._value;
    }
    set displayDateEnd(value) {
        this._value = value;
    }
    /**
     * Gets or sets the `value` property.
     *
     * @public
     * @override
     */
    get value() {
        return this._value;
    }
    set value(value) {
        if (!isValidValue(value)) {
            value = null;
        }
        if (isDate(value)) {
            value = getDateOnly(value);
        }
        if (this._value !== value) {
            this._value = value;
            this.requestUpdate('value');
        }
    }
    /**
     * Gets or sets the `displayValue` property.
     *
     * @public
     * @readonly
     */
    get displayValue() {
        return this._displayValue;
    }
    set displayValue(value) {
        if (this._displayValue !== value) {
            this._displayValue = value;
            this.requestUpdate('displayValue');
        }
    }
    /**
     * Gets or sets the `readonly` property.
     *
     * @public
     * @attr
     */
    get readonly() {
        return this._readonly;
    }
    set readonly(value) {
        if (this._readonly !== value) {
            this._readonly = value;
            this.requestUpdate('readonly');
        }
    }
    /**
     * Gets or sets the `required` property.
     *
     * @public
     * @attr
     */
    get required() {
        return this._required;
    }
    set required(value) {
        if (this._required !== value) {
            this._required = value;
            this.requestUpdate('required');
        }
    }
    /**
     * Gets or sets the `autofocus` property.
     *
     * @public
     * @override
     */
    get autofocus() {
        return this._autofocus;
    }
    set autofocus(value) {
        if (this._autofocus !== value) {
            this._autofocus = value;
            this.requestUpdate('autofocus');
        }
    }
    /**
     * Gets or sets the `name` property.
     *
     * @public
     * @attr
     */
    get name() {
        return this._name;
    }
    set name(value) {
        if (this._name !== value) {
            this._name = value;
            this.requestUpdate('name');
        }
    }
    /**
     * Gets or sets the `placeholder` property.
     *
     * @public
     * @attr
     */
    get placeholder() {
        return this._placeholder;
    }
    set placeholder(value) {
        if (this._placeholder !== value) {
            this._placeholder = value;
            this.requestUpdate('placeholder');
        }
    }
    /**
     * Gets or sets the `autocomplete` property.
     *
     * @public
     * @attr
     */
    get autocomplete() {
        return this._autocomplete;
    }
    set autocomplete(value) {
        if (this._autocomplete !== value) {
            this._autocomplete = value;
            this.requestUpdate('autocomplete');
        }
    }
    /**
     * Gets or sets the `values` property.
     *
     * @public
     * @attr
     */
    get values() {
        return this._values;
    }
    set values(value) {
        if (this._values !== value) {
            this._values = value;
            this.requestUpdate('values');
        }
    }
    /**
     * Gets or sets the `view` property.
     *
     * @public
     * @attr
     */
    get view() {
        return this._view;
    }
    set view(value) {
        if (this._view !== value) {
            this._view = value;
            this.requestUpdate('view');
        }
    }
    /**
     * Gets or sets the `blackoutDates` property.
     *
     * @public
     * @attr
     */
    get blackoutDates() {
        return this._blackoutDates;
    }
    set blackoutDates(value) {
        if (this._blackoutDates !== value) {
            this._blackoutDates = value;
            this.requestUpdate('blackoutDates');
        }
    }
    /**
     * Gets or sets the `specialDates` property.
     *
     * @public
     * @attr
     */
    get specialDates() {
        return this._specialDates;
    }
    set specialDates(value) {
        if (this._specialDates !== value) {
            this._specialDates = value;
            this.requestUpdate('specialDates');
        }
    }
    /**
     * Gets or sets the `minDate` property.
     *
     * @public
     * @attr
     */
    get minDate() {
        return this._minDate;
    }
    set minDate(value) {
        if (this._minDate !== value) {
            this._minDate = value;
            this.requestUpdate('minDate');
        }
    }
    /**
     * Gets or sets the `maxDate` property.
     *
     * @public
     * @attr
     */
    get maxDate() {
        return this._maxDate;
    }
    set maxDate(value) {
        if (this._maxDate !== value) {
            this._maxDate = value;
            this.requestUpdate('maxDate');
        }
    }
    /**
     * Gets or sets the `firstDayOfWeek` property.
     *
     * @public
     * @attr
     */
    get firstDayOfWeek() {
        return this._firstDayOfWeek;
    }
    set firstDayOfWeek(value) {
        if (this._firstDayOfWeek !== value) {
            this._firstDayOfWeek = value;
            this.requestUpdate('firstDayOfWeek');
        }
    }
    /**
     * Gets or sets the `isTodayHighlighted` property.
     *
     * @public
     * @attr
     */
    get isTodayHighlighted() {
        return this._isTodayHighlighted;
    }
    set isTodayHighlighted(value) {
        if (this._isTodayHighlighted !== value) {
            this._isTodayHighlighted = value;
            this.requestUpdate('isTodayHighlighted');
        }
    }
    /**
     * Gets or sets the `isWeekendHighlighted` property.
     *
     * @public
     * @attr
     */
    get isWeekendHighlighted() {
        return this._isWeekendHighlighted;
    }
    set isWeekendHighlighted(value) {
        if (this._isWeekendHighlighted !== value) {
            this._isWeekendHighlighted = value;
            this.requestUpdate('isWeekendHighlighted');
        }
    }
    /**
     * Gets or sets the `showWeekNumbers` property.
     *
     * @public
     * @attr
     */
    get showWeekNumbers() {
        return this._showWeekNumbers;
    }
    set showWeekNumbers(value) {
        if (this._showWeekNumbers !== value) {
            this._showWeekNumbers = value;
            this.requestUpdate('showWeekNumbers');
        }
    }
    /**
     * A handler that gets date and returns null or a tuple with circled marker data. See {@link CalendarMarkerData}.
     *
     * @public
     */
    get markerHandler() {
        return this._markerHandler;
    }
    set markerHandler(value) {
        if (this._markerHandler !== value) {
            this._markerHandler = value;
            this.requestUpdate('markerHandler');
        }
    }
    /**
     * Gets or sets the `showAdjacent` property.
     *
     * @public
     * @attr
     */
    get showAdjacent() {
        return this._showAdjacent;
    }
    set showAdjacent(value) {
        if (this._showAdjacent !== value) {
            this._showAdjacent = value;
            this.requestUpdate('showAdjacent');
        }
    }
    /**
     * Gets or sets the `format` property.
     *
     * Supported format specifiers:
     * - `d`   : Day of the month (1-31) without leading zero.
     * - `dd`  : Day of the month (01-31) with leading zero.
     * - `ddd` : Abbreviated name of the day of the week (e.g., Mon, Tue).
     * - `dddd`: Full name of the day of the week (e.g., Monday, Tuesday).
     * - `h`   : Hour (1-12) in 12-hour format without leading zero.
     * - `hh`  : Hour (01-12) in 12-hour format with leading zero.
     * - `H`   : Hour (0-23) in 24-hour format without leading zero.
     * - `HH`  : Hour (00-23) in 24-hour format with leading zero.
     * - `m`   : Minute (0-59) without leading zero.
     * - `mm`  : Minute (00-59) with leading zero.
     * - `M`   : Month (1-12) without leading zero.
     * - `MM`  : Month (01-12) with leading zero.
     * - `MMM` : Abbreviated name of the month (e.g., Jan, Feb).
     * - `MMMM`: Full name of the month (e.g., January, February).
     * - `s`   : Second (0-59) without leading zero.
     * - `ss`  : Second (00-59) with leading zero.
     * - `t`   : First character of the AM/PM designator (e.g., A or P).
     * - `tt`  : Full AM/PM designator (e.g., AM or PM).
     * - `y`   : Year as the last two digits without leading zero (e.g., 9 for 2009).
     * - `yy`  : Year as the last two digits with leading zero (e.g., 09 for 2009).
     * - `yyy` : Year with a minimum of three digits (e.g., 009, 2009).
     * - `yyyy`: Year as a four-digit number (e.g., 2009).
     * - `:`   : Time separator (e.g., colon).
     * - `/`   : Date separator (e.g., slash).
     *
     * @public
     * @attr
     */
    get format() {
        return this._format;
    }
    set format(value) {
        if (this._format !== value) {
            this._format = value;
            this.requestUpdate('format');
        }
    }
    /**
     * Determines the text alignment of the component.
     *
     * @public
     * @attr
     */
    get textAlign() {
        return this._textAlign;
    }
    set textAlign(value) {
        if (this._textAlign !== value) {
            this._textAlign = value;
            this.requestUpdate('textAlign');
        }
    }
    /**
     * Determines whether the element has a prefix or not.
     * The Prefix is a slot that is displayed before the input.
     *
     * @private
     * @readonly
     * @attr
     */
    get hasPrefix() {
        return this.hasSlotContent('prefix');
    }
    /**
     * Determines whether the element has a suffix or not.
     * The Suffix is a slot that is displayed after the input.
     *
     * @private
     * @readonly
     * @attr
     */
    get hasSuffix() {
        return this.hasSlotContent('suffix');
    }
    /**
     * @protected
     * @readonly
     */
    get keyboard() {
        return this._keyboardController;
    }
    // #endregion
    // #region Methods
    /**
     * @public
     * @override
     */
    connectedCallback() {
        super.connectedCallback();
        this.keyboard
            .add([Key.Space, Key.Enter], () => this.toggle(), undefined, { preventDefault: true })
            .add([Key.Escape], () => {
            if (this.isDropDownOpen) {
                this.close();
            }
            else {
                this.clear();
            }
        }, undefined, { preventDefault: true })
            .add([Key.Tab], () => this.close());
        this.on('click', () => this.focus());
    }
    /**
     * Sets focus on the input.
     *
     * @public
     * @override
     */
    focus() {
        if (this.shadowRoot) {
            DomServiceLocator.current.findDescendant(this.shadowRoot, 'input')?.focus();
        }
    }
    /**
     * Removes keyboard focus from the input.
     *
     * @public
     * @override
     */
    blur() {
        if (this.shadowRoot) {
            DomServiceLocator.current.findDescendant(this.shadowRoot, 'input')?.blur();
        }
    }
    /**
     * Clears the value of the element but not the validation.
     *
     * @public
     * @override
     */
    clear(force) {
        const isCleared = super.clear(force);
        if (isCleared) {
            this.emit('change', {
                bubbles: true,
                composed: true
            });
        }
        return isCleared;
    }
    /**
     * Resets the value, all kinds of validation and errors.
     *
     * @public
     * @override
     */
    reset() {
        super.reset();
        this.clear();
        this._invalidInput = false;
        this.invalid = false;
    }
    /**
     * Checks the validity of the element and returns `true` if it is valid; otherwise, `false`.
     *
     * @public
     * @override
     */
    checkValidity() {
        return this.shadowRoot
            ? (this._inputElement?.checkValidity() && !this._invalidInput) ?? true
            : true;
    }
    /**
     * @protected
     * @template
     */
    onChange(event) {
        if (!event.target) {
            return;
        }
        if (event.target instanceof HTMLInputElement) {
            const inputValue = event.target.value;
            const date = DateParser.tryParse(inputValue, this._format, this.locale);
            if (date) {
                const formattedDate = DateTimeFormatter.format(date, this._format, this.locale);
                this.displayValue = formattedDate;
                this.value = date;
                this._invalidInput = false;
            }
            else {
                this.value = null;
                this._invalidInput = true;
            }
        }
        this.emit('change', { detail: this.value });
    }
    /**
     * @protected
     * @template
     * @override
     */
    onInput(event) {
        super.onInput(event);
        this.emit('input', { detail: this.value });
    }
    /**
     * @protected
     * @template
     * @override
     */
    onFocus(event) {
        super.onFocus(event);
        this.emit('focus', { detail: event });
    }
    /**
     * @protected
     * @template
     * @override
     */
    onBlur(event) {
        super.onBlur(event);
        this.emit('blur', { detail: event });
    }
    /**
     * @protected
     * @template
     */
    onDateChanged(detail) {
        this.value = detail.value?.date ?? null;
        this.emit('change', { detail: this.value });
        this.close();
    }
    /**
     * @protected
     */
    onIsDropDownOpenPropertyChanged(_prev, next) {
        if (next) {
            this._clickOutsideController.observe();
        }
        else {
            this._clickOutsideController.unobserve();
        }
    }
    /**
     * @protected
     */
    onFormatPropertyChanged(_prev, next) {
        if (this.value && next) {
            const formattedDate = DateTimeFormatter.format(this.value, next, this.locale);
            this.displayValue = formattedDate;
        }
    }
    /**
     * @protected
     */
    onDisabledPropertyChanged(_prev, next) {
        if (next) {
            this.close();
        }
    }
    /**
     * @protected
     */
    onValuePropertyChanged(_prev, next) {
        if (next) {
            const formattedDate = DateTimeFormatter.format(next, this._format, this.locale);
            this.displayValue = formattedDate;
        }
    }
};
__decorate([
    QueryChild('[part="input"]'),
    __metadata("design:type", HTMLInputElement)
], DateTimeBoxElement.prototype, "_inputElement", void 0);
__decorate([
    Property({ type: Date }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateTimeBoxElement.prototype, "displayDate", null);
__decorate([
    Property({ type: Date }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateTimeBoxElement.prototype, "displayDateStart", null);
__decorate([
    Property({ type: Date }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateTimeBoxElement.prototype, "displayDateEnd", null);
__decorate([
    Attribute({
        type: Date,
        converter: {
            fromAttribute: (value) => value ? new Date(value) : null,
            toAttribute: (value) => value ? value.toISOString() : ''
        }
    }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateTimeBoxElement.prototype, "value", null);
__decorate([
    Property({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateTimeBoxElement.prototype, "displayValue", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateTimeBoxElement.prototype, "readonly", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateTimeBoxElement.prototype, "required", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateTimeBoxElement.prototype, "autofocus", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateTimeBoxElement.prototype, "name", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateTimeBoxElement.prototype, "placeholder", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateTimeBoxElement.prototype, "autocomplete", null);
__decorate([
    Attribute({
        type: (Array),
        converter: {
            fromAttribute: (value) => !value
                ? undefined
                : value
                    .split(' ')
                    .map((v) => v.trim())
                    .filter((v) => v)
                    .map((v) => new Date(v)),
            toAttribute: (value) => value.map((v) => v.toISOString()).join(' ')
        }
    }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], DateTimeBoxElement.prototype, "values", null);
__decorate([
    Attribute({ type: CalendarView }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateTimeBoxElement.prototype, "view", null);
__decorate([
    Attribute({ type: (Array) }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], DateTimeBoxElement.prototype, "blackoutDates", null);
__decorate([
    Attribute({ type: (Array) }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], DateTimeBoxElement.prototype, "specialDates", null);
__decorate([
    Attribute({
        type: Date,
        converter: {
            fromAttribute: (value) => value ? new Date(value) : new Date(),
            toAttribute: (value) => value ? value.toISOString() : ''
        }
    }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateTimeBoxElement.prototype, "minDate", null);
__decorate([
    Attribute({
        type: Date,
        converter: {
            fromAttribute: (value) => value ? new Date(value) : new Date(),
            toAttribute: (value) => value ? value.toISOString() : ''
        }
    }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], DateTimeBoxElement.prototype, "maxDate", null);
__decorate([
    Attribute({ type: DayOfWeek }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], DateTimeBoxElement.prototype, "firstDayOfWeek", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateTimeBoxElement.prototype, "isTodayHighlighted", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateTimeBoxElement.prototype, "isWeekendHighlighted", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateTimeBoxElement.prototype, "showWeekNumbers", null);
__decorate([
    Property({ type: Function }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Function])
], DateTimeBoxElement.prototype, "markerHandler", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], DateTimeBoxElement.prototype, "showAdjacent", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateTimeBoxElement.prototype, "format", null);
__decorate([
    Attribute({ type: TextAlignment }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], DateTimeBoxElement.prototype, "textAlign", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [])
], DateTimeBoxElement.prototype, "hasPrefix", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [])
], DateTimeBoxElement.prototype, "hasSuffix", null);
__decorate([
    Watch('isDropDownOpen', { waitUntilFirstUpdate: true }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Boolean, Boolean]),
    __metadata("design:returntype", void 0)
], DateTimeBoxElement.prototype, "onIsDropDownOpenPropertyChanged", null);
__decorate([
    Watch('format', { waitUntilFirstUpdate: true }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, String]),
    __metadata("design:returntype", void 0)
], DateTimeBoxElement.prototype, "onFormatPropertyChanged", null);
__decorate([
    Watch('disabled', { waitUntilFirstUpdate: true }),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Boolean, Boolean]),
    __metadata("design:returntype", void 0)
], DateTimeBoxElement.prototype, "onDisabledPropertyChanged", null);
__decorate([
    Watch('value'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", void 0)
], DateTimeBoxElement.prototype, "onValuePropertyChanged", null);
DateTimeBoxElement = DateTimeBoxElement_1 = __decorate([
    Component({
        selector: 'mosaik-datetimebox',
        template: dateTimeBoxElementTemplate,
        themes: {
            joy: dateTimeBoxElementJoyStyle,
            retro: dateTimeBoxElementRetroStyle,
            cosmopolitan: dateTimeBoxElementCosmopolitanStyle
        },
        host: {
            tabIndex: '0'
        },
        options: {
            mode: 'open',
            delegatesFocus: true
        },
        imports: [
            IconElement,
            PopupElement,
            CalendarElement,
            FocusRingElement,
            FloatingElement,
            PortalElement
        ]
    }),
    __metadata("design:paramtypes", [])
], DateTimeBoxElement);
export { DateTimeBoxElement };
/**
 * Checks if the provided value is valid for a input.
 * A valid value can be a Date or null
 *
 * @private
 * @param value - The value to check.
 */
function isValidValue(value) {
    return value instanceof Date || value === null;
}
//# sourceMappingURL=DateTimeBoxElement.js.map