"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 childrenWithProps () {
        return childrenWithProps;
    },
    get getCorrectHeight () {
        return getCorrectHeight;
    },
    get getItemByFocused () {
        return _getItemByFocused.getItemByFocused;
    },
    get getItemId () {
        return _getItemId.getItemId;
    },
    get getPlacement () {
        return _getPlacement.getPlacement;
    },
    get getValidComponent () {
        return getValidComponent;
    }
});
var _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
var _getItemId = require("./getItemId");
var _getItemByFocused = require("./getItemByFocused");
var _getPlacement = require("./getPlacement");
function _getRequireWildcardCache(nodeInterop) {
    if (typeof WeakMap !== "function") return null;
    var cacheBabelInterop = new WeakMap();
    var cacheNodeInterop = new WeakMap();
    return (_getRequireWildcardCache = function(nodeInterop) {
        return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
    })(nodeInterop);
}
function _interop_require_wildcard(obj, nodeInterop) {
    if (!nodeInterop && obj && obj.__esModule) {
        return obj;
    }
    if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
        return {
            default: obj
        };
    }
    var cache = _getRequireWildcardCache(nodeInterop);
    if (cache && cache.has(obj)) {
        return cache.get(obj);
    }
    var newObj = {
        __proto__: null
    };
    var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
    for(var key in obj){
        if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
            var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
            if (desc && (desc.get || desc.set)) {
                Object.defineProperty(newObj, key, desc);
            } else {
                newObj[key] = obj[key];
            }
        }
    }
    newObj.default = obj;
    if (cache) {
        cache.set(obj, newObj);
    }
    return newObj;
}
function _type_of(obj) {
    "@swc/helpers - typeof";
    return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
}
var getCorrectHeight = function getCorrectHeight(listMaxHeight) {
    if (Number.isNaN(Number(listMaxHeight))) {
        return listMaxHeight.toString();
    }
    return "".concat(listMaxHeight, "rem");
};
var childrenWithProps = function childrenWithProps(children, additionalProps) {
    return _react.Children.map(children, function(child) {
        if (/*#__PURE__*/ _react.default.isValidElement(child)) {
            return /*#__PURE__*/ _react.default.cloneElement(child, additionalProps);
        }
        return child;
    });
};
var isReactObject = function isReactObject(element) {
    return (typeof element === "undefined" ? "undefined" : _type_of(element)) === 'object' || typeof element === 'function';
};
var getValidComponent = function getValidComponent(element, props) {
    if (/*#__PURE__*/ (0, _react.isValidElement)(element)) {
        return /*#__PURE__*/ (0, _react.cloneElement)(element, props);
    }
    if (isReactObject(element)) {
        var Component = element;
        return /*#__PURE__*/ _react.default.createElement(Component, props);
    }
    return element;
};
