"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PageBreaksXform = void 0;
const base_xform_1 = require("../base-xform.js");
/**
 * Xform for individual page break (brk element)
 * Used by both RowBreaksXform and ColBreaksXform
 */
class PageBreaksXform extends base_xform_1.BaseXform {
    get tag() {
        return "brk";
    }
    render(xmlStream, model) {
        xmlStream.leafNode("brk", model);
    }
    parseOpen(node) {
        if (node.name === "brk") {
            const { id, max, man, min } = node.attributes;
            this.model = {
                id: +id,
                max: +max,
                man: +man
            };
            if (min !== undefined) {
                this.model.min = +min;
            }
            return true;
        }
        return false;
    }
    parseText() { }
    parseClose() {
        return false;
    }
}
exports.PageBreaksXform = PageBreaksXform;
