// #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 { CustomElement } from '../../Abstracts/CustomElement';
import { epgMinimapElementTemplate } from './EpgMinimapElementTemplate';
import { epgMinimapElementJoyStyle } from './Themes/EpgMinimapElement.Joy';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Listen } from '../../../../events/Decorators/ListenDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { Required } from '../../../Decorators/RequiredDecorator';
// #endregion
/**
 * The `{@link EpgMinimapElement}` element.
 *
 * @public
 */
let EpgMinimapElement = class EpgMinimapElement extends CustomElement {
    // #region Fields
    _lanes;
    _visibleStart;
    _visibleEnd;
    _channels;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._lanes = 0;
        this._visibleStart = 0;
        this._visibleEnd = 10;
        this._channels = [];
    }
    // #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-epg-minimap';
    }
    /**
     * Gets or sets the `lanes` property.
     *
     * @public
     * @attr
     */
    get lanes() {
        return this._lanes;
    }
    set lanes(value) {
        if (this._lanes !== value) {
            this._lanes = value;
            this.requestUpdate('lanes');
        }
    }
    /**
     * Gets or sets the `visibleStart` property.
     *
     * @public
     * @attr
     */
    get visibleStart() {
        return this._visibleStart;
    }
    set visibleStart(value) {
        if (this._visibleStart !== value) {
            this._visibleStart = value;
            this.requestUpdate('visibleStart');
        }
    }
    /**
     * Gets or sets the `visibleEnd` property.
     *
     * @public
     * @attr
     */
    get visibleEnd() {
        return this._visibleEnd;
    }
    set visibleEnd(value) {
        if (this._visibleEnd !== value) {
            this._visibleEnd = value;
            this.requestUpdate('visibleEnd');
        }
    }
    /**
     * Gets or sets the `channels` property.
     *
     * @public
     */
    get channels() {
        return this._channels;
    }
    set channels(value) {
        if (this._channels !== value) {
            this._channels = value;
            this.requestUpdate('channels');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @protected
     */
    onClick(e) {
        const y = e.offsetY;
        const row = Math.floor(y / 4);
        this.dispatchEvent(new CustomEvent('jumpToRow', {
            detail: row,
            bubbles: true,
            composed: true
        }));
    }
};
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], EpgMinimapElement.prototype, "lanes", null);
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], EpgMinimapElement.prototype, "visibleStart", null);
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], EpgMinimapElement.prototype, "visibleEnd", null);
__decorate([
    Required(),
    Property({ type: (Array) }),
    __metadata("design:type", Array),
    __metadata("design:paramtypes", [Array])
], EpgMinimapElement.prototype, "channels", null);
__decorate([
    Listen('click'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [MouseEvent]),
    __metadata("design:returntype", void 0)
], EpgMinimapElement.prototype, "onClick", null);
EpgMinimapElement = __decorate([
    Component({
        selector: 'mosaik-epg-minimap',
        template: epgMinimapElementTemplate,
        styles: epgMinimapElementJoyStyle,
        imports: []
    }),
    __metadata("design:paramtypes", [])
], EpgMinimapElement);
export { EpgMinimapElement };
//# sourceMappingURL=EpgMinimapElement.js.map