// #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);
};
import { Attribute } from '../../..//Decorators/AttributeDecorator';
import { Appearanceable } from '../../../Behaviors/Appearanceable';
import { Disableable } from '../../../Behaviors/Disableable';
import { Localeable } from '../../../Behaviors/Localeable';
import { Variantable } from '../../../Behaviors/Variantable';
import { InlineStyleController } from '../../../Controllers/InlineStyleController';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { TextElement } from '../../Primitives/Text/TextElement';
import { epgTimelineElementTemplate } from './EpgTimelineElementTemplate';
import { epgTimelineElementJoyStyle } from './Themes/EpgTimelineElement.Joy';
// #endregion
/**
 * EPG Timeline - A time-axis header rendered above an Electronic Program Guide grid.
 *
 * Displays hour/minute labels across the horizontal axis using configurable width, format,
 * and sidebar offset values. Typically used as an internal sub-component of `mosaik-epg`.
 *
 * @name EpgTimelineElement
 * @element mosaik-epg-timeline
 * @category Selectors
 *
 * @csspart container - The container part.
 * @csspart divider - The divider part.
 * @csspart dividers - The dividers part.
 * @csspart label - The label part.
 *
 * @cssprop {String} --epg-timeline-background-color - The timeline background color CSS custom property.
 * @cssprop {String} --epg-timeline-border-color - The timeline border color CSS custom property.
 * @cssprop {String} --epg-timeline-border-radius - The timeline border radius CSS custom property.
 * @cssprop {String} --epg-timeline-border-style - The timeline border style CSS custom property.
 * @cssprop {String} --epg-timeline-border-width - The timeline border width CSS custom property.
 * @cssprop {String} --epg-timeline-font-family - The timeline font family CSS custom property.
 * @cssprop {String} --epg-timeline-font-letter-spacing - The timeline font letter spacing CSS custom property.
 * @cssprop {String} --epg-timeline-font-line-height - The timeline font line height CSS custom property.
 * @cssprop {String} --epg-timeline-font-size - The timeline font size CSS custom property.
 * @cssprop {String} --epg-timeline-font-text-decoration - The timeline font text decoration CSS custom property.
 * @cssprop {String} --epg-timeline-font-text-transform - The timeline font text transform CSS custom property.
 * @cssprop {String} --epg-timeline-font-weight - The timeline font weight CSS custom property.
 * @cssprop {String} --epg-timeline-foreground-color - The timeline foreground color CSS custom property.
 * @cssprop {String} --epg-timeline-gap - The timeline gap CSS custom property.
 * @cssprop {String} --epg-timeline-padding-bottom - The timeline padding bottom CSS custom property.
 * @cssprop {String} --epg-timeline-padding-left - The timeline padding left CSS custom property.
 * @cssprop {String} --epg-timeline-padding-right - The timeline padding right CSS custom property.
 * @cssprop {String} --epg-timeline-padding-top - The timeline padding top CSS custom property.
 * @cssprop {String} --epg-timeline-shadow - The timeline shadow CSS custom property.
 * @cssprop {String} --epg-timeline-shadow-blur - The timeline shadow blur CSS custom property.
 * @cssprop {String} --epg-timeline-shadow-color - The timeline shadow color CSS custom property.
 * @cssprop {String} --epg-timeline-shadow-offset-x - The timeline shadow offset x CSS custom property.
 * @cssprop {String} --epg-timeline-shadow-offset-y - The timeline shadow offset y CSS custom property.
 * @cssprop {String} --epg-timeline-shadow-spread - The timeline shadow spread CSS custom property.
 * @cssprop {String} --epg-timeline-transition-duration - The timeline transition duration CSS custom property.
 * @cssprop {String} --epg-timeline-transition-mode - The timeline transition mode CSS custom property.
 * @cssprop {String} --epg-timeline-transition-property - The timeline transition property CSS custom property.
 * @cssprop {String} --epg-timeline-translate - The timeline translate CSS custom property.
 *
 * @dependency mosaik-text - The Text element.
 *
 * @example
 * ```html
 * <mosaik-epg-timeline
 *   day-width="7200"
 *   hour-width="300"
 *   number-of-hours-in-day="24"
 *   sidebar-width="100"
 *   has-sidebar
 *   format="HH:mm">
 * </mosaik-epg-timeline>
 * ```
 *
 * @public
 */
let EpgTimelineElement = class EpgTimelineElement extends Localeable(Disableable(Variantable(Appearanceable(CustomElement)))) {
    // #region Fields
    _inlineStyleController;
    _dayWidth;
    _hourWidth;
    _numberOfHoursInDay;
    _offsetStartHoursRange;
    _sidebarWidth;
    _hasSidebar;
    _format;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._dayWidth = 7200;
        this._hourWidth = 300;
        this._numberOfHoursInDay = 24;
        this._offsetStartHoursRange = 0;
        this._sidebarWidth = 100;
        this._hasSidebar = false;
        this._format = 'HH:mm';
        this._inlineStyleController = new InlineStyleController(this);
        this._inlineStyleController.set('epg-timeline-start-position', '100px');
        this._inlineStyleController.set('epg-day-width', '7200px');
        this._inlineStyleController.set('epg-hour-width', '300px');
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     * The `is` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-epg-timeline';
    }
    /**
     * @public
     * @attr
     */
    get dayWidth() {
        return this._dayWidth;
    }
    set dayWidth(value) {
        if (this._dayWidth !== value) {
            this._dayWidth = value;
            this._inlineStyleController.set('epg-day-width', `${value}px`);
            this.requestUpdate('dayWidth');
        }
    }
    /**
     * @public
     * @attr
     */
    get hourWidth() {
        return this._hourWidth;
    }
    set hourWidth(value) {
        if (this._hourWidth !== value) {
            this._hourWidth = value;
            this._inlineStyleController.set('epg-hour-width', `${value}px`);
            this.requestUpdate('hourWidth');
        }
    }
    /**
     * @public
     * @attr
     */
    get numberOfHoursInDay() {
        return this._numberOfHoursInDay;
    }
    set numberOfHoursInDay(value) {
        if (this._numberOfHoursInDay !== value) {
            this._numberOfHoursInDay = value;
            this.requestUpdate('numberOfHoursInDay');
        }
    }
    /**
     * @public
     * @attr
     */
    get offsetStartHoursRange() {
        return this._offsetStartHoursRange;
    }
    set offsetStartHoursRange(value) {
        if (this._offsetStartHoursRange !== value) {
            this._offsetStartHoursRange = value;
            this.requestUpdate('offsetStartHoursRange');
        }
    }
    /**
     * @public
     * @attr
     */
    get sidebarWidth() {
        return this._sidebarWidth;
    }
    set sidebarWidth(value) {
        if (this._sidebarWidth !== value) {
            this._sidebarWidth = value;
            this._inlineStyleController.set('epg-timeline-start-position', `${value}px`);
            this.requestUpdate('sidebarWidth');
        }
    }
    /**
     * @public
     * @attr
     */
    get hasSidebar() {
        return this._hasSidebar;
    }
    set hasSidebar(value) {
        if (this._hasSidebar !== value) {
            this._hasSidebar = value;
            this.requestUpdate('hasSidebar');
        }
    }
    /**
     * @public
     * @attr
     */
    get format() {
        return this._format;
    }
    set format(value) {
        if (this._format !== value) {
            this._format = value;
            this.requestUpdate('format');
        }
    }
};
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], EpgTimelineElement.prototype, "dayWidth", null);
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], EpgTimelineElement.prototype, "hourWidth", null);
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], EpgTimelineElement.prototype, "numberOfHoursInDay", null);
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], EpgTimelineElement.prototype, "offsetStartHoursRange", null);
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], EpgTimelineElement.prototype, "sidebarWidth", null);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], EpgTimelineElement.prototype, "hasSidebar", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], EpgTimelineElement.prototype, "format", null);
EpgTimelineElement = __decorate([
    Component({
        selector: 'mosaik-epg-timeline',
        template: epgTimelineElementTemplate,
        styles: epgTimelineElementJoyStyle,
        imports: [
            TextElement
        ]
    }),
    __metadata("design:paramtypes", [])
], EpgTimelineElement);
export { EpgTimelineElement };
//# sourceMappingURL=EpgTimelineElement.js.map