/**
 * @license
 * Copyright Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { attachShadowTemplate, CustomElement } from '@tylertech/forge-core';
import { tylIconInsertInvitation } from '@tylertech/tyler-icons/standard';
import { CalendarComponent } from '../calendar';
import { IconComponent, IconRegistry } from '../icon';
import { IconButtonComponent } from '../icon-button';
import { PopoverComponent } from '../popover';
import { BaseDatePickerComponent } from './base/base-date-picker';
import { BASE_DATE_PICKER_CONSTANTS } from './base/base-date-picker-constants';
import { DatePickerAdapter } from './date-picker-adapter';
import { DATE_PICKER_CONSTANTS } from './date-picker-constants';
import { DatePickerFoundation } from './date-picker-foundation';
const template = '<template><slot></slot></template>';
const styles = ':host{display:block}:host([hidden]){display:none}';
/**
 * @tag forge-date-picker
 */
let DatePickerComponent = class DatePickerComponent extends BaseDatePickerComponent {
    static get observedAttributes() {
        return [
            ...Object.values(BASE_DATE_PICKER_CONSTANTS.observedAttributes),
            DATE_PICKER_CONSTANTS.observedAttributes.VALUE
        ];
    }
    constructor() {
        super();
        IconRegistry.define(tylIconInsertInvitation);
        attachShadowTemplate(this, template, styles);
        this._foundation = new DatePickerFoundation(new DatePickerAdapter(this));
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case DATE_PICKER_CONSTANTS.observedAttributes.VALUE:
                this.value = newValue;
                return;
        }
        super.attributeChangedCallback(name, oldValue, newValue);
    }
};
DatePickerComponent = __decorate([
    CustomElement({
        name: DATE_PICKER_CONSTANTS.elementName,
        dependencies: [
            PopoverComponent,
            CalendarComponent,
            IconButtonComponent,
            IconComponent
        ]
    })
], DatePickerComponent);
export { DatePickerComponent };
