"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 getChildren () {
        return getChildren;
    },
    get updatePropsRecursively () {
        return updatePropsRecursively;
    }
});
var _react = require("react");
var updatePropsRecursively = function updatePropsRecursively(children, activeIndex, view, disabled, updateValue) {
    return _react.Children.map(children || [], function(child, index) {
        if (!(0, _react.isValidElement)(child)) {
            return child;
        }
        var props = {
            index: index,
            value: !!((activeIndex === null || activeIndex === void 0 ? void 0 : activeIndex.findIndex(function(i) {
                var _child_props_eventKey;
                return i === ((_child_props_eventKey = child.props.eventKey) !== null && _child_props_eventKey !== void 0 ? _child_props_eventKey : index);
            })) !== -1),
            view: view,
            disabled: disabled,
            onChange: updateValue
        };
        return (0, _react.cloneElement)(child, props);
    });
};
var getChildren = function getChildren(children, activeIndex, view, disabled, updateValue) {
    return updatePropsRecursively(children, activeIndex, view, disabled, updateValue);
};
