import { AppObjectPM } from "@vived/core";
import { CalloutEntity, } from "../Entities/CalloutEntity";
export class CalloutOffsetPM extends AppObjectPM {
    static get(id, appObjects) {
        return appObjects
            .get(id)
            ?.getComponent(CalloutOffsetPM.type);
    }
}
CalloutOffsetPM.type = "CalloutOffsetPM";
export function makeCalloutOffsetPM(appObject) {
    return new CalloutOffsetPMImp(appObject);
}
class CalloutOffsetPMImp extends CalloutOffsetPM {
    get callout() {
        return this.getCachedLocalComponent(CalloutEntity.type);
    }
    vmsAreEqual(a, b) {
        return a === b;
    }
    constructor(appObject) {
        super(appObject, CalloutOffsetPM.type);
        this.onChange = () => {
            if (!this.callout)
                return;
            this.doUpdateView(this.callout.offsetDirection);
        };
        this.callout?.addChangeObserver(this.onChange);
        this.onChange();
    }
}
//# sourceMappingURL=CalloutOffsetPM.js.map