"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CfvoExtXform = void 0;
const composite_xform_1 = require("../../composite-xform.js");
const f_ext_xform_1 = require("./f-ext-xform.js");
class CfvoExtXform extends composite_xform_1.CompositeXform {
    constructor() {
        super();
        this.map = {
            "xm:f": (this.fExtXform = new f_ext_xform_1.FExtXform())
        };
    }
    get tag() {
        return "x14:cfvo";
    }
    render(xmlStream, model) {
        xmlStream.openNode(this.tag, {
            type: model.type
        });
        if (model.value !== undefined) {
            this.fExtXform.render(xmlStream, model.value);
        }
        xmlStream.closeNode();
    }
    createNewModel(node) {
        return {
            type: node.attributes.type
        };
    }
    onParserClose(name, parser) {
        switch (name) {
            case "xm:f":
                this.model.value = parser.model ? parseFloat(parser.model) : 0;
                break;
        }
    }
}
exports.CfvoExtXform = CfvoExtXform;
