"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Semifunctional_1 = require("../../../../../Class/Semifunctional");
const _ids_1 = require("../../../../_ids");
const globalComponent_1 = require("../../../../globalComponent");
class GetClientBoundingRect extends Semifunctional_1.Semifunctional {
    constructor(system) {
        super({
            fi: ['component', 'any'],
            fo: ['rect'],
            i: [],
            o: ['done'],
        }, {
            input: {
                component: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_GET_CLIENT_BOUNDING_RECT);
    }
    async f({ component, any: opt }, done) {
        const globalId = component.getGlobalId();
        const component_ = (await (0, globalComponent_1.firstGlobalComponentPromise)(this.__system, globalId));
        const leaf = component_.getFirstRootLeaf();
        const rect = leaf.getBoundingClientRect();
        done({ rect });
    }
    b() {
        this._output.done.push(true);
    }
}
exports.default = GetClientBoundingRect;
//# sourceMappingURL=index.js.map