import { xmlDecode } from "../../../../../utils/utils.browser.js";
import { BaseXform } from "../base-xform.js";
class WorksheetXform extends BaseXform {
    render(xmlStream, model) {
        xmlStream.leafNode("sheet", {
            name: model.name,
            sheetId: model.id,
            // Excel doesn't output state when it's 'visible' (default)
            state: model.state === "visible" ? undefined : model.state,
            "r:id": model.rId
        });
    }
    parseOpen(node) {
        if (node.name === "sheet") {
            this.model = {
                name: xmlDecode(node.attributes.name),
                id: parseInt(node.attributes.sheetId, 10),
                state: node.attributes.state,
                rId: node.attributes["r:id"]
            };
            return true;
        }
        return false;
    }
    parseText() { }
    parseClose() {
        return false;
    }
}
export { WorksheetXform };
