"use strict";
/*---------------------------------------------------------------------------------------------
 * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
 * See LICENSE.md in the project root for license terms and full copyright notice.
 *--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
 * @module StatusBar
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.StatusBarItemUtilities = void 0;
const React = require("react");
const StatusBarItem_1 = require("./StatusBarItem");
const BackstageItemUtilities_1 = require("../backstage/BackstageItemUtilities");
/** Utility functions for creating and maintaining StatusBar items.
 * @public
 */
var StatusBarItemUtilities;
(function (StatusBarItemUtilities) {
    function createDeprecatedActionItem(...[id, section, itemPriority, icon, tooltip, execute, overrides,]) {
        return {
            id,
            section,
            itemPriority,
            icon,
            tooltip,
            execute,
            ...overrides,
        };
    }
    /** Creates a StatusBar item to perform an action. */
    function createActionItem(...args) {
        if ((0, BackstageItemUtilities_1.isArgsUtil)(args)) {
            const { execute = () => { }, itemPriority = 0, section = StatusBarItem_1.StatusBarSection.Center, icon, ...other } = args[0];
            return {
                execute,
                itemPriority,
                section,
                iconNode: icon,
                icon: icon ? React.createElement(React.Fragment, null, icon) : undefined,
                ...other,
            };
        }
        return createDeprecatedActionItem(...args);
    }
    StatusBarItemUtilities.createActionItem = createActionItem;
    function createDeprecatedLabelItem(...[id, section, itemPriority, icon, label, labelSide = StatusBarItem_1.StatusBarLabelSide.Right, overrides,]) {
        return {
            id,
            section,
            itemPriority,
            icon,
            label,
            labelSide,
            ...overrides,
        };
    }
    /** Creates a StatusBar item to display a label. */
    function createLabelItem(...args) {
        if ((0, BackstageItemUtilities_1.isArgsUtil)(args)) {
            const { label = "", itemPriority = 0, section = StatusBarItem_1.StatusBarSection.Center, icon, ...other } = args[0];
            return {
                label,
                itemPriority,
                section,
                iconNode: icon,
                icon: icon ? React.createElement(React.Fragment, null, icon) : undefined,
                ...other,
            };
        }
        return createDeprecatedLabelItem(...args);
    }
    StatusBarItemUtilities.createLabelItem = createLabelItem;
    function createDeprecatedCustomItem(...[id, section, itemPriority, content, overrides,]) {
        return {
            id,
            section,
            itemPriority,
            content,
            ...overrides,
        };
    }
    /** Creates a StatusBar item to display a custom content. */
    function createCustomItem(...args) {
        if ((0, BackstageItemUtilities_1.isArgsUtil)(args)) {
            const { content = undefined, itemPriority = 0, section = StatusBarItem_1.StatusBarSection.Center, ...other } = args[0];
            return {
                content,
                itemPriority,
                section,
                ...other,
            };
        }
        return createDeprecatedCustomItem(...args);
    }
    StatusBarItemUtilities.createCustomItem = createCustomItem;
})(StatusBarItemUtilities || (exports.StatusBarItemUtilities = StatusBarItemUtilities = {}));
//# sourceMappingURL=StatusBarItemUtilities.js.map