/**
 * @license
 * Copyright 2023 Tyler Technologies, Inc. 
 * License: Apache-2.0
 */
import { __decorate } from "tslib";
import { CustomElement, attachShadowTemplate, FoundationProperty, coerceBoolean, elementParents } from '@tylertech/forge-core';
import { CalendarMenuAdapter } from './calendar-menu-adapter';
import { CALENDAR_MENU_CONSTANTS } from './calendar-menu-constants';
import { CalendarMenuFoundation } from './calendar-menu-foundation';
const template = '<template><div class=\"forge-calendar-menu\" part=\"root\"></div></template>';
const styles = '.forge-calendar-menu{background-color:#fff;background-color:var(--mdc-theme-surface,#fff);position:relative;height:100%;width:100%;overflow:hidden}.forge-calendar-menu__view{position:absolute;top:0;left:0;height:100%;width:100%;background-color:inherit}.forge-calendar-menu__grid{max-height:320px;max-height:var(--forge-calendar-menu-max-height,320px);display:grid;gap:16px;justify-items:center;-webkit-box-align:center;align-items:center;padding:8px;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-calendar-menu__grid--three-col{grid-template-columns:repeat(3,1fr)}.forge-calendar-menu__grid--four-col{grid-template-columns:repeat(4,1fr)}.forge-calendar-menu__list{position:relative;background-color:inherit}.forge-calendar-menu__list__wrapper{position:relative;height:100%;overflow:auto}.forge-calendar-menu__list__wrapper::-webkit-scrollbar{width:16px;width:var(--forge-scrollbar-width,16px);height:16px;height:var(--forge-scrollbar-height,16px)}.forge-calendar-menu__list__wrapper::-webkit-scrollbar-corner{background-color:#f0f0f0;background-color:var(--forge-theme-scrollbar-track,#f0f0f0)}.forge-calendar-menu__list__wrapper::-webkit-scrollbar-track{background-color:#f0f0f0;background-color:var(--forge-theme-scrollbar-track,#f0f0f0)}.forge-calendar-menu__list__wrapper::-webkit-scrollbar-track:hover{background-color:#ececec;background-color:var(--forge-theme-scrollbar-track-hover,#ececec)}.forge-calendar-menu__list__wrapper::-webkit-scrollbar-thumb{background-color:#bdbdbd;background-color:var(--forge-theme-scrollbar-thumb,#bdbdbd);height:32px;height:var(--forge-scrollbar-min-height,32px);width:32px;width:var(--forge-scrollbar-min-width,32px);border-radius:10px;border-radius:var(--forge-scrollbar-border-radius,10px);border-width:3px;border-width:var(--forge-scrollbar-border-width,3px);border-style:solid;border-color:transparent;background-clip:content-box}.forge-calendar-menu__list__wrapper::-webkit-scrollbar-thumb:hover{background-color:#9e9e9e;background-color:var(--forge-theme-scrollbar-thumb-hover,#9e9e9e)}.forge-calendar-menu__item--grid{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;position:relative;width:100%;height:100%;border-radius:4px;overflow:hidden;font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.forge-calendar-menu__item--grid:not([disabled]){--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;border:1px solid #e0e0e0;cursor:pointer}.forge-calendar-menu__item--grid:not([disabled])::after,.forge-calendar-menu__item--grid:not([disabled])::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\"\"}.forge-calendar-menu__item--grid:not([disabled])::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.forge-calendar-menu__item--grid:not([disabled])::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.forge-calendar-menu__item--grid:not([disabled]).mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.forge-calendar-menu__item--grid:not([disabled]).mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.forge-calendar-menu__item--grid:not([disabled]).mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.forge-calendar-menu__item--grid:not([disabled]).mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.forge-calendar-menu__item--grid:not([disabled]).mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.forge-calendar-menu__item--grid:not([disabled])::after,.forge-calendar-menu__item--grid:not([disabled])::before{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.forge-calendar-menu__item--grid:not([disabled]).mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-calendar-menu__item--grid:not([disabled])::after,.forge-calendar-menu__item--grid:not([disabled])::before{background-color:#3f51b5;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#3f51b5))}.forge-calendar-menu__item--grid:not([disabled]).mdc-ripple-surface--hover::before,.forge-calendar-menu__item--grid:not([disabled]):hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-calendar-menu__item--grid:not([disabled]).mdc-ripple-upgraded--background-focused::before,.forge-calendar-menu__item--grid:not([disabled]):not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-calendar-menu__item--grid:not([disabled]):not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-calendar-menu__item--grid:not([disabled]):not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-calendar-menu__item--grid:not([disabled]).mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.forge-calendar-menu__item--grid[disabled]{color:rgba(0,0,0,.12);color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-calendar-menu__item--grid.forge-calendar-menu__item--selected{color:#fff;color:var(--mdc-theme-on-primary,#fff);background-color:#3f51b5;background-color:var(--mdc-theme-primary,#3f51b5)}.forge-calendar-menu__item--grid.forge-calendar-menu__item--selected:hover{opacity:.87}.forge-calendar-menu__item--grid.forge-calendar-menu__item--selected.mdc-ripple-upgraded--background-focused,.forge-calendar-menu__item--grid.forge-calendar-menu__item--selected:focus{opacity:.54}.forge-calendar-menu__item--list{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;margin:0 4px;width:calc(100% - 8px);height:48px;border-radius:4px;overflow:hidden;text-align:center;cursor:pointer}.forge-calendar-menu__item--list::after,.forge-calendar-menu__item--list::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\"\"}.forge-calendar-menu__item--list::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.forge-calendar-menu__item--list::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.forge-calendar-menu__item--list.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.forge-calendar-menu__item--list.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.forge-calendar-menu__item--list.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.forge-calendar-menu__item--list.mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.forge-calendar-menu__item--list.mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.forge-calendar-menu__item--list::after,.forge-calendar-menu__item--list::before{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.forge-calendar-menu__item--list.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-calendar-menu__item--list::after,.forge-calendar-menu__item--list::before{background-color:#000;background-color:var(--mdc-ripple-color,var(--mdc-theme-on-surface,#000))}.forge-calendar-menu__item--list.mdc-ripple-surface--hover::before,.forge-calendar-menu__item--list:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-calendar-menu__item--list.mdc-ripple-upgraded--background-focused::before,.forge-calendar-menu__item--list:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-calendar-menu__item--list:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-calendar-menu__item--list:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-calendar-menu__item--list.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.forge-calendar-menu__item--list--activated::before{opacity:.12;opacity:var(--mdc-ripple-activated-opacity, .12)}.forge-calendar-menu__item--list--activated::after,.forge-calendar-menu__item--list--activated::before{background-color:#3f51b5;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#3f51b5))}.forge-calendar-menu__item--list--activated.mdc-ripple-surface--hover::before,.forge-calendar-menu__item--list--activated:hover::before{opacity:.16;opacity:var(--mdc-ripple-hover-opacity, .16)}.forge-calendar-menu__item--list--activated.mdc-ripple-upgraded--background-focused::before,.forge-calendar-menu__item--list--activated:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-focus-opacity, .24)}.forge-calendar-menu__item--list--activated:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-calendar-menu__item--list--activated:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-press-opacity, .24)}.forge-calendar-menu__item--list--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.forge-calendar-menu__item--list--selected::before{opacity:.08;opacity:var(--mdc-ripple-selected-opacity, .08)}.forge-calendar-menu__item--list--selected::after,.forge-calendar-menu__item--list--selected::before{background-color:#3f51b5;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#3f51b5))}.forge-calendar-menu__item--list--selected.mdc-ripple-surface--hover::before,.forge-calendar-menu__item--list--selected:hover::before{opacity:.12;opacity:var(--mdc-ripple-hover-opacity, .12)}.forge-calendar-menu__item--list--selected.mdc-ripple-upgraded--background-focused::before,.forge-calendar-menu__item--list--selected:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.2;opacity:var(--mdc-ripple-focus-opacity, .2)}.forge-calendar-menu__item--list--selected:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-calendar-menu__item--list--selected:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.2;opacity:var(--mdc-ripple-press-opacity, .2)}.forge-calendar-menu__item--list--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.forge-calendar-menu__item--list--selected:focus:hover.mdc-ripple-upgraded--background-focused:not(.mdc-ripple-upgraded--foreground-activation)::before{opacity:.28}.forge-calendar-menu__item--list--active:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::before,.forge-calendar-menu__item--list:focus:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::before{opacity:.12}.forge-calendar-menu__item--list--active:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation):hover::before,.forge-calendar-menu__item--list:focus:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation):hover::before{opacity:.16}.forge-calendar-menu__item--list--active:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::after,.forge-calendar-menu__item--list--active:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::before,.forge-calendar-menu__item--list:focus:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::after,.forge-calendar-menu__item--list:focus:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::before{background-color:#000;background-color:var(--mdc-theme-on-surface,#000)}.forge-calendar-menu__item--list--active:focus.forge-list-item--selected.forge-list-item--activated:not(.mdc-ripple-upgraded--foreground-activation)::before{opacity:.24}.forge-calendar-menu__item--list--active:focus.forge-list-item--selected.forge-list-item--activated:not(.mdc-ripple-upgraded--foreground-activation):hover::before{opacity:.28}.forge-calendar-menu__item--list.forge-calendar-menu__item--selected{background-color:#3f51b5;background-color:var(--mdc-theme-primary,#3f51b5);color:#fff;color:var(--mdc-theme-on-primary,#fff)}.forge-calendar-menu__item--list.forge-calendar-menu__item--selected:hover{opacity:.87}.forge-calendar-menu__item--list.forge-calendar-menu__item--selected.mdc-ripple-upgraded--background-focused,.forge-calendar-menu__item--list.forge-calendar-menu__item--selected:focus{opacity:.54}.forge-calendar-menu__item .mdc-ripple-upgraded--background-focused,.forge-calendar-menu__item--focused,.forge-calendar-menu__item:focus{outline:0}.forge-calendar-menu--open{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-name:scale-open;animation-name:scale-open;-webkit-transform-origin:top center;transform-origin:top center}.forge-calendar-menu--open[data-animation=fade]{-webkit-animation-name:fade-in;animation-name:fade-in}.forge-calendar-menu--open[data-animation=none]{-webkit-animation-duration:1ms;animation-duration:1ms}@media (prefers-reduced-motion){.forge-calendar-menu--open{-webkit-animation-name:fade-in;animation-name:fade-in}}.forge-calendar-menu--closing{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-name:scale-closed;animation-name:scale-closed;-webkit-transform-origin:top center;transform-origin:top center}.forge-calendar-menu--closing[data-animation=fade]{-webkit-animation-name:fade-out;animation-name:fade-out}.forge-calendar-menu--closing[data-animation=none]{-webkit-animation-duration:1ms;animation-duration:1ms}@media (prefers-reduced-motion){.forge-calendar-menu--closing{-webkit-animation-name:fade-out;animation-name:fade-out}}.forge-calendar-menu--slide-right .forge-calendar-menu__view:first-child{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-name:slide-out-to-right;animation-name:slide-out-to-right}@media (prefers-reduced-motion){.forge-calendar-menu--slide-right .forge-calendar-menu__view:first-child{-webkit-animation-name:fade-out;animation-name:fade-out}}.forge-calendar-menu--slide-right .forge-calendar-menu__view:last-child{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-name:slide-in-from-left;animation-name:slide-in-from-left}@media (prefers-reduced-motion){.forge-calendar-menu--slide-right .forge-calendar-menu__view:last-child{-webkit-animation-name:fade-in;animation-name:fade-in}}.forge-calendar-menu--slide-left .forge-calendar-menu__view:first-child{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-name:slide-out-to-left;animation-name:slide-out-to-left}@media (prefers-reduced-motion){.forge-calendar-menu--slide-left .forge-calendar-menu__view:first-child{-webkit-animation-name:fade-out;animation-name:fade-out}}.forge-calendar-menu--slide-left .forge-calendar-menu__view:last-child{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-name:slide-in-from-right;animation-name:slide-in-from-right}@media (prefers-reduced-motion){.forge-calendar-menu--slide-left .forge-calendar-menu__view:last-child{-webkit-animation-name:fade-in;animation-name:fade-in}}.forge-calendar-menu--replacing-view .forge-calendar-menu__view:first-child{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-name:fade-out;animation-name:fade-out}.forge-calendar-menu--replacing-view .forge-calendar-menu__view:last-child{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-name:fade-in;animation-name:fade-in}#scroll-spy-bottom{position:absolute;bottom:0;height:48px;pointer-events:none}#scroll-spy-top{position:absolute;top:0;height:48px;pointer-events:none}@-webkit-keyframes scale-open{from{opacity:0;-webkit-transform:scale(.4);transform:scale(.4)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes scale-open{from{opacity:0;-webkit-transform:scale(.4);transform:scale(.4)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes scale-closed{from{opacity:1;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform:scale(.4);transform:scale(.4)}}@keyframes scale-closed{from{opacity:1;-webkit-transform:scale(1);transform:scale(1)}to{opacity:0;-webkit-transform:scale(.4);transform:scale(.4)}}@-webkit-keyframes fade-in{from{opacity:0}to{opacity:1}}@keyframes fade-in{from{opacity:0}to{opacity:1}}@-webkit-keyframes fade-out{from{opacity:1}to{opacity:0}}@keyframes fade-out{from{opacity:1}to{opacity:0}}@-webkit-keyframes slide-in-from-left{from{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-from-left{from{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slide-in-from-right{from{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-from-right{from{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slide-out-to-left{from{-webkit-transform:translateX(0);transform:translateX(0)}to{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}@keyframes slide-out-to-left{from{-webkit-transform:translateX(0);transform:translateX(0)}to{-webkit-transform:translateX(-100%);transform:translateX(-100%)}}@-webkit-keyframes slide-out-to-right{from{-webkit-transform:translateX(0);transform:translateX(0)}to{-webkit-transform:translateX(100%);transform:translateX(100%)}}@keyframes slide-out-to-right{from{-webkit-transform:translateX(0);transform:translateX(0)}to{-webkit-transform:translateX(100%);transform:translateX(100%)}}:host{display:block;position:absolute;top:0;left:0;height:100%;width:100%}:host([hidden]){display:none}:host([forge-popup-context=true]) .forge-calendar-menu{background-color:#fff;background-color:var(--forge-theme-elevated-surface,#fff)}';
/**
 * The web component class behind the `<forge-calendar-menu>` custom element.
 *
 * @internal
 * @tag forge-calendar-menu
 */
let CalendarMenuComponent = class CalendarMenuComponent extends HTMLElement {
    constructor() {
        super();
        attachShadowTemplate(this, template, styles);
        this._foundation = new CalendarMenuFoundation(new CalendarMenuAdapter(this));
    }
    static get observedAttributes() {
        return [
            CALENDAR_MENU_CONSTANTS.attributes.ANIMATION_TYPE,
            CALENDAR_MENU_CONSTANTS.attributes.PREVENT_FOCUS
        ];
    }
    connectedCallback() {
        // To simulate the :host-context() selector for Firefox until they implement it, we need to determine if the
        // calendar is within a popup for auto-styling the calendar when included within a popup. Check to see if
        // any of the parents of this element are a popup.
        if (!this.hasAttribute(CALENDAR_MENU_CONSTANTS.attributes.POPUP_CONTEXT) && elementParents(this).some(el => el.tagName.toLowerCase() === 'forge-popup')) {
            this.setAttribute(CALENDAR_MENU_CONSTANTS.attributes.POPUP_CONTEXT, 'true');
        }
        this._foundation.initialize();
    }
    disconnectedCallback() {
        this._foundation.disconnect();
    }
    attributeChangedCallback(name, oldValue, newValue) {
        switch (name) {
            case CALENDAR_MENU_CONSTANTS.attributes.ANIMATION_TYPE:
                this.animationType = newValue;
                break;
            case CALENDAR_MENU_CONSTANTS.attributes.PREVENT_FOCUS:
                this.preventFocus = coerceBoolean(newValue);
                break;
        }
    }
    animateIn(options, direction, setFocus = false) {
        this._foundation.animateIn(options, direction, setFocus);
    }
    close() {
        this._foundation.close();
    }
    moveFocusDown() {
        this._foundation.moveFocusDown();
    }
    moveFocusBackward() {
        return this._foundation.moveFocusBackward();
    }
    moveFocusForward() {
        return this._foundation.moveFocusForward();
    }
    moveFocusUp() {
        this._foundation.moveFocusUp();
    }
    openAsGrid(options, setFocus = false) {
        this._foundation.openAsGrid(options, setFocus);
    }
    openAsList(options, setFocus = false) {
        this._foundation.openAsList(options, setFocus);
    }
    selectFocusedItem() {
        this._foundation.selectFocusedItem();
    }
};
__decorate([
    FoundationProperty()
], CalendarMenuComponent.prototype, "animationType", void 0);
__decorate([
    FoundationProperty()
], CalendarMenuComponent.prototype, "preventFocus", void 0);
CalendarMenuComponent = __decorate([
    CustomElement({
        name: CALENDAR_MENU_CONSTANTS.elementName
    })
], CalendarMenuComponent);
export { CalendarMenuComponent };
