'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const __chunk_1 = require('./chunk-2755df65.js');

class RouterMenu {
    constructor(hostRef) {
        __chunk_1.registerInstance(this, hostRef);
        this.changed = __chunk_1.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 (__chunk_1.h("div", null, "ema-router-menu"));
    }
    get el() { return __chunk_1.getElement(this); }
}

exports.ema_router_menu = RouterMenu;
