"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 Toolbar
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.toUIAToolbarItem = void 0;
const ToolbarItem_1 = require("./ToolbarItem");
/** @internal */
function toUIAToolbarItem(item) {
    if ((0, ToolbarItem_1.isToolbarCustomItem)(item)) {
        return {
            ...item,
            badgeType: item.badge, // eslint-disable-line deprecation/deprecation
            badgeKind: item.badgeKind,
            isCustom: true,
            icon: item.iconNode ?? item.icon, // eslint-disable-line deprecation/deprecation
            panelContentNode: item.panelContent,
        };
    }
    if ((0, ToolbarItem_1.isToolbarGroupItem)(item)) {
        return {
            ...item,
            items: item.items.map(toUIAToolbarItem),
            badgeType: item.badge, // eslint-disable-line deprecation/deprecation
            badgeKind: item.badgeKind,
            icon: item.iconNode ?? item.icon, // eslint-disable-line deprecation/deprecation
        };
    }
    return {
        ...item,
        badgeType: item.badge, // eslint-disable-line deprecation/deprecation
        badgeKind: item.badgeKind,
        icon: item.iconNode ?? item.icon, // eslint-disable-line deprecation/deprecation
    };
}
exports.toUIAToolbarItem = toUIAToolbarItem;
//# sourceMappingURL=toUIAToolbarItem.js.map