import { r as registerInstance, c as createEvent, h, g as getElement } from './chunk-82a2445c.js';

class RouterMenu {
    constructor(hostRef) {
        registerInstance(this, hostRef);
        this.changed = createEvent(this, "changed", 7);
    }
    componentDidLoad() {
        this.postRender();
    }
    componentDidUpdate() {
        this.postRender();
    }
    postRender() {
        this.changed.emit({ data: this.getData(), el: this.el });
    }
    async setData(data, extend = false) {
        if (!this.data)
            this.data = {};
        if (extend) {
            Object.keys(data).forEach((k) => {
                this.data[k] = data[k];
            });
            return;
        }
        this.data = data;
    }
    async getData() {
        return this.data;
    }
    render() {
        if (this.dataJson) {
            this.data = JSON.parse(this.dataJson);
        }
        return (h("div", null, "ema-router-menu"));
    }
    get el() { return getElement(this); }
}

export { RouterMenu as ema_router_menu };
