/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { attachShadowTemplate, CustomElement, FoundationProperty } from '@tylertech/forge-core';
import { tylIconDateRange } from '@tylertech/tyler-icons/standard';
import { CalendarComponent } from '../calendar';
import { BaseDatePickerComponent } from '../date-picker/base/base-date-picker';
import { BASE_DATE_PICKER_CONSTANTS } from '../date-picker/base/base-date-picker-constants';
import { IconComponent, IconRegistry } from '../icon';
import { IconButtonComponent } from '../icon-button';
import { PopupComponent } from '../popup';
import { DateRangePickerAdapter } from './date-range-picker-adapter';
import { DATE_RANGE_PICKER_CONSTANTS } from './date-range-picker-constants';
import { DateRangePickerFoundation } from './date-range-picker-foundation';
const template = '<template><slot></slot></template>';
const styles = ':host{display:block}:host([hidden]){display:none}';
/**
 * The custom element class behind the `<forge-date-range-picker>` element.
 *
 * @tag forge-date-range-picker
 */
let DateRangePickerComponent = class DateRangePickerComponent extends BaseDatePickerComponent {
    static get observedAttributes() {
        return [
            ...Object.values(BASE_DATE_PICKER_CONSTANTS.observedAttributes),
            DATE_RANGE_PICKER_CONSTANTS.observedAttributes.FROM,
            DATE_RANGE_PICKER_CONSTANTS.observedAttributes.TO
        ];
    }
    constructor() {
        super();
        IconRegistry.define(tylIconDateRange);
        attachShadowTemplate(this, template, styles);
        this._foundation = new DateRangePickerFoundation(new DateRangePickerAdapter(this));
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case DATE_RANGE_PICKER_CONSTANTS.observedAttributes.FROM:
                this.from = newValue;
                return;
            case DATE_RANGE_PICKER_CONSTANTS.observedAttributes.TO:
                this.to = newValue;
                return;
        }
        super.attributeChangedCallback(name, oldValue, newValue);
    }
};
__decorate([
    FoundationProperty()
], DateRangePickerComponent.prototype, "from", void 0);
__decorate([
    FoundationProperty()
], DateRangePickerComponent.prototype, "to", void 0);
DateRangePickerComponent = __decorate([
    CustomElement({
        name: DATE_RANGE_PICKER_CONSTANTS.elementName,
        dependencies: [
            PopupComponent,
            CalendarComponent,
            IconButtonComponent,
            IconComponent
        ]
    })
], DateRangePickerComponent);
export { DateRangePickerComponent };
