import { Injectable } from '@angular/core';
export var RGlobalLogicalPosition;
(function (RGlobalLogicalPosition) {
    RGlobalLogicalPosition["TOP_START"] = "top-start";
    RGlobalLogicalPosition["TOP_END"] = "top-end";
    RGlobalLogicalPosition["BOTTOM_START"] = "bottom-start";
    RGlobalLogicalPosition["BOTTOM_END"] = "bottom-end";
})(RGlobalLogicalPosition || (RGlobalLogicalPosition = {}));
export var RGlobalPhysicalPosition;
(function (RGlobalPhysicalPosition) {
    RGlobalPhysicalPosition["TOP_RIGHT"] = "top-right";
    RGlobalPhysicalPosition["TOP_LEFT"] = "top-left";
    RGlobalPhysicalPosition["BOTTOM_RIGHT"] = "bottom-right";
    RGlobalPhysicalPosition["BOTTOM_LEFT"] = "bottom-left";
})(RGlobalPhysicalPosition || (RGlobalPhysicalPosition = {}));
export class RPositionHelper {
    // constructor(protected layoutDirection: RLayoutDirectionService) {
    // }
    toLogicalPosition(position) {
        if (Object.values(RGlobalLogicalPosition).includes(position)) {
            return position;
        }
        return this.toLogicalPositionWhenLtr(position);
        // if (this.layoutDirection.isLtr()) {
        //   return this.toLogicalPositionWhenLtr(position as RGlobalPhysicalPosition);
        // } else {
        //   return this.toLogicalPositionWhenRtl(position as RGlobalPhysicalPosition);
        // }
    }
    toPhysicalPosition(position) {
        if (Object.values(RGlobalPhysicalPosition).includes(position)) {
            return position;
        }
        return this.toPhysicalPositionWhenLtr(position);
        // if (this.layoutDirection.isLtr()) {
        //   return this.toPhysicalPositionWhenLtr(position as RGlobalLogicalPosition);
        // } else {
        //   return this.toPhysicalPositionWhenRtl(position as RGlobalLogicalPosition);
        // }
    }
    isTopPosition(position) {
        const logicalPosition = this.toLogicalPosition(position);
        return logicalPosition === RGlobalLogicalPosition.TOP_END
            || logicalPosition === RGlobalLogicalPosition.TOP_START;
    }
    isRightPosition(position) {
        const physicalPosition = this.toPhysicalPosition(position);
        return physicalPosition === RGlobalPhysicalPosition.TOP_RIGHT
            || physicalPosition === RGlobalPhysicalPosition.BOTTOM_RIGHT;
    }
    toLogicalPositionWhenLtr(position) {
        switch (position) {
            case RGlobalPhysicalPosition.TOP_RIGHT:
                return RGlobalLogicalPosition.TOP_END;
            case RGlobalPhysicalPosition.TOP_LEFT:
                return RGlobalLogicalPosition.TOP_START;
            case RGlobalPhysicalPosition.BOTTOM_RIGHT:
                return RGlobalLogicalPosition.BOTTOM_END;
            case RGlobalPhysicalPosition.BOTTOM_LEFT:
                return RGlobalLogicalPosition.BOTTOM_START;
        }
    }
    toLogicalPositionWhenRtl(position) {
        switch (position) {
            case RGlobalPhysicalPosition.TOP_RIGHT:
                return RGlobalLogicalPosition.TOP_START;
            case RGlobalPhysicalPosition.TOP_LEFT:
                return RGlobalLogicalPosition.TOP_END;
            case RGlobalPhysicalPosition.BOTTOM_RIGHT:
                return RGlobalLogicalPosition.BOTTOM_START;
            case RGlobalPhysicalPosition.BOTTOM_LEFT:
                return RGlobalLogicalPosition.BOTTOM_END;
        }
    }
    toPhysicalPositionWhenLtr(position) {
        switch (position) {
            case RGlobalLogicalPosition.TOP_START:
                return RGlobalPhysicalPosition.TOP_LEFT;
            case RGlobalLogicalPosition.TOP_END:
                return RGlobalPhysicalPosition.TOP_RIGHT;
            case RGlobalLogicalPosition.BOTTOM_START:
                return RGlobalPhysicalPosition.BOTTOM_LEFT;
            case RGlobalLogicalPosition.BOTTOM_END:
                return RGlobalPhysicalPosition.BOTTOM_RIGHT;
        }
    }
    toPhysicalPositionWhenRtl(position) {
        switch (position) {
            case RGlobalLogicalPosition.TOP_START:
                return RGlobalPhysicalPosition.TOP_RIGHT;
            case RGlobalLogicalPosition.TOP_END:
                return RGlobalPhysicalPosition.TOP_LEFT;
            case RGlobalLogicalPosition.BOTTOM_START:
                return RGlobalPhysicalPosition.BOTTOM_RIGHT;
            case RGlobalLogicalPosition.BOTTOM_END:
                return RGlobalPhysicalPosition.BOTTOM_LEFT;
        }
    }
}
RPositionHelper.decorators = [
    { type: Injectable }
];
//# sourceMappingURL=position-helper.js.map