/**
 * Traverses the tree nodes and calls a callback when no hidden node is found. The callback
 * is called with visual column index then.
 *
 * @param {TreeNode} node A tree node to traverse.
 * @param {Function} callback The callback function which will be called for each node.
 */ "use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get getFirstChildProperty () {
        return getFirstChildProperty;
    },
    get isNodeReflectsFirstChildColspan () {
        return isNodeReflectsFirstChildColspan;
    },
    get traverseHiddenNodeColumnIndexes () {
        return traverseHiddenNodeColumnIndexes;
    }
});
function traverseHiddenNodeColumnIndexes(node, callback) {
    node.walkDown(({ data, childs })=>{
        if (!data.isHidden) {
            callback(data.columnIndex);
            if (childs.length === 0) {
                for(let i = 1; i < data.colspan; i++){
                    callback(data.columnIndex + i);
                }
            }
        }
    });
}
function getFirstChildProperty({ childs }, propertyName) {
    if (childs.length === 0) {
        return;
    }
    return childs[0].data[propertyName];
}
function isNodeReflectsFirstChildColspan(node) {
    return getFirstChildProperty(node, 'origColspan') === node.data.origColspan;
}
