"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 Utilities
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapToPlacement = exports.mapToRelativePosition = void 0;
const appui_abstract_1 = require("@itwin/appui-abstract");
/**
 * Utility for converting a Placement or RelativePosition to a RelativePosition.
 * Should be removed N+1 major versions after RelativePosition's deprecation.
 * @internal
 */
function mapToRelativePosition(input) {
    if (typeof input === "string")
        return placementToRelativePositionMap[input];
    return input;
}
exports.mapToRelativePosition = mapToRelativePosition;
/**
 * Utility for converting a RelativePosition to a Placement.
 * Should most likely be removed N+1 major versions after RelativePosition's deprecation.
 * @internal
 */
function mapToPlacement(input) {
    if (!input)
        return "top-end";
    if (typeof input === "string")
        return input;
    return relativePositionToPlacementMap[input];
}
exports.mapToPlacement = mapToPlacement;
const placementToRelativePositionMap = {
    left: appui_abstract_1.RelativePosition.Left,
    top: appui_abstract_1.RelativePosition.Top,
    right: appui_abstract_1.RelativePosition.Right,
    bottom: appui_abstract_1.RelativePosition.Bottom,
    "left-start": appui_abstract_1.RelativePosition.LeftTop,
    "left-end": appui_abstract_1.RelativePosition.Left,
    "right-start": appui_abstract_1.RelativePosition.RightTop,
    "right-end": appui_abstract_1.RelativePosition.Right,
    "top-start": appui_abstract_1.RelativePosition.TopLeft,
    "top-end": appui_abstract_1.RelativePosition.TopRight,
    "bottom-start": appui_abstract_1.RelativePosition.BottomLeft,
    "bottom-end": appui_abstract_1.RelativePosition.BottomRight,
};
const relativePositionToPlacementMap = {
    [appui_abstract_1.RelativePosition.Left]: "left",
    [appui_abstract_1.RelativePosition.Top]: "top",
    [appui_abstract_1.RelativePosition.Right]: "right",
    [appui_abstract_1.RelativePosition.Bottom]: "bottom",
    [appui_abstract_1.RelativePosition.LeftTop]: "left-start",
    [appui_abstract_1.RelativePosition.RightTop]: "right-start",
    [appui_abstract_1.RelativePosition.TopLeft]: "top-start",
    [appui_abstract_1.RelativePosition.TopRight]: "top-end",
    [appui_abstract_1.RelativePosition.BottomLeft]: "bottom-start",
    [appui_abstract_1.RelativePosition.BottomRight]: "bottom-end",
};
//# sourceMappingURL=Placement.js.map