import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-ClISz4NF.js';
import { v as validateProp } from './props-CJZgTDla.js';
import { A as AccordionItemClass, a as AccordionClass, b as AccordionSizes } from './constants-DbTQsVRc.js';
import { g as govHost } from './template-CoD1xawt.js';
import './gov.log-BtqD9K8d.js';
import './utils-CQvUntGY.js';
import './sizes-BcQO4NH2.js';

const GovAccordion = class {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.govChange = createEvent(this, "gov-change");
        this.hydrated = false;
        /**
         * Accordion’s size.
         */
        this.size = 'm';
        /**
         * Accordion item underline
         */
        this.noBorder = false;
        this.h = govHost(this.host);
    }
    validateSize(newValue) {
        validateProp(AccordionSizes, newValue, AccordionClass.root);
    }
    componentWillLoad() {
        this.validateSize(this.size);
    }
    componentDidLoad() {
        this.host.querySelectorAll(AccordionItemClass.root).forEach((child) => {
            child.addEventListener('gov-change', (e) => {
                e.stopPropagation();
                this.govChange.emit({
                    component: AccordionClass.root,
                    open: e.detail.open,
                    ref: e.detail.ref
                });
            });
        });
    }
    connectedCallback() {
        this.hydrated = true;
    }
    render() {
        return (h(Host, { key: '62ad311346ed2f7caa86f8085b4ee9a7a81c5f92', hydrated: this.hydrated, class: this.h.classes(AccordionClass.root), size: this.size, role: 'list' }, h("slot", { key: 'c4fade9da340c36695c6781e411abac9202ffdf8' })));
    }
    get host() { return getElement(this); }
    static get watchers() { return {
        "size": ["validateSize"]
    }; }
};

export { GovAccordion as gov_accordion };
//# sourceMappingURL=gov-accordion.entry.js.map

//# sourceMappingURL=gov-accordion.entry.js.map