"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UIContent = void 0;
var aurelia_framework_1 = require("aurelia-framework");
var resize_observer_polyfill_1 = __importDefault(require("resize-observer-polyfill"));
var ui_internal_1 = require("../../utils/ui-internal");
var UIContent = exports.UIContent = (function () {
    function UIContent(element) {
        this.element = element;
    }
    UIContent.prototype.attached = function () {
        var _this = this;
        this.obResize = new resize_observer_polyfill_1.default(function () {
            return _this.element.dispatchEvent(ui_internal_1.UIInternal.createEvent("resize", _this.element.getBoundingClientRect()));
        });
        this.obResize.observe(this.element);
    };
    UIContent.prototype.detached = function () {
        this.obResize.disconnect();
    };
    UIContent = __decorate([
        (0, aurelia_framework_1.customElement)("ui-content"),
        (0, aurelia_framework_1.inlineView)("<template class=\"ui-section__content\" ref=\"vmElement\"><slot></slot></template>"),
        __metadata("design:paramtypes", [Element])
    ], UIContent);
    return UIContent;
}());

//# sourceMappingURL=ui-content.js.map
