"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AllowHoverLabelPM = void 0;
exports.makeAllowHoverLabelPM = makeAllowHoverLabelPM;
const core_1 = require("@vived/core");
const HoverLabelEntity_1 = require("../Entities/HoverLabelEntity");
class AllowHoverLabelPM extends core_1.AppObjectPM {
}
exports.AllowHoverLabelPM = AllowHoverLabelPM;
AllowHoverLabelPM.type = "AllowHoverLabelPM";
AllowHoverLabelPM.get = (appObjects) => (0, core_1.getSingletonComponent)(AllowHoverLabelPM.type, appObjects);
function makeAllowHoverLabelPM(appObject) {
    return new AllowHoverLabelPMImp(appObject);
}
class AllowHoverLabelPMImp extends AllowHoverLabelPM {
    get hoverLabelEntity() {
        return this.getCachedSingleton(HoverLabelEntity_1.HoverLabelEntity.type);
    }
    vmsAreEqual(a, b) {
        return a === b;
    }
    constructor(appObject) {
        super(appObject, AllowHoverLabelPM.type);
        this.onEntityChange = () => {
            if (!this.hoverLabelEntity)
                return;
            this.doUpdateView(this.hoverLabelEntity.allowHoverLabel);
        };
        this.hoverLabelEntity?.addChangeObserver(this.onEntityChange);
        this.onEntityChange();
        this.appObjects.registerSingleton(this);
    }
}
//# sourceMappingURL=AllowHoverLabelPM.js.map