var MediaTool = /** @class */ (function () {
    function MediaTool() {
    }
    ////////////////////////////////////////////////////////////////
    // Static Methods
    ////////////////////////////////////////////////////////////////
    /**
     * Get the first MediaElement found
     * @param input MediaElement or MediaElement[]
     */
    MediaTool.element = function (input) {
        if (Array.isArray(input) && input.length > 0)
            return input[0];
        return input;
    };
    /**
     * Get the first MediaElement found in the given size
     * @param input MediaElement or MediaElement[]
     * @param size xs, s, m, l , xl, xxl
     * @param defaultImage url
     */
    MediaTool.size = function (input, size, defaultImage) {
        var element = this.element(input);
        return typeof element !== 'undefined' && size in element ? element[size] : defaultImage;
    };
    /**
     * Get the audio of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    MediaTool.audio = function (input) {
        return this.size(input, 'media', 'http://www.mp3classicalmusic.net/48Music/Vivaldi48/Stagioni4-3.mp3');
    };
    /**
     * Get the media of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    MediaTool.media = function (input) {
        return this.size(input, 'media', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    };
    /**
     * Get the xs size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    MediaTool.imageXS = function (input) {
        return this.size(input, 'xs', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    };
    /**
     * Get the s size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    MediaTool.imageS = function (input) {
        return this.size(input, 's', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    };
    /**
     * Get the m size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    MediaTool.imageM = function (input) {
        return this.size(input, 'm', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    };
    /**
     * Get the l size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    MediaTool.imageL = function (input) {
        return this.size(input, 'l', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    };
    /**
     * Get the xl size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    MediaTool.imageXL = function (input) {
        return this.size(input, 'xl', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    };
    /**
     * Get the xxl size of the first MediaElement
     * @param input MediaElement or MediaElement[]
     */
    MediaTool.imageXXL = function (input) {
        return this.size(input, 'xxl', 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    };
    /**
     * Get the size of a MediaElement depending on web or phone mode
     * @param isWeb
     * @param webSize
     * @param phoneSize
     * @param input
     */
    MediaTool.image = function (isWeb, webSize, phoneSize, input) {
        return this.size(input, isWeb ? webSize : phoneSize, 'https://d3m7xw68ay40x8.cloudfront.net/assets/2014/07/16144215/roads.jpg');
    };
    /**
     * Get a fullscreen (XXL on web and XL on phone)
     * @param isWeb
     * @param input
     */
    MediaTool.fullScreen = function (isWeb, input) {
        return this.image(isWeb, 'xl', 'xl', input);
    };
    return MediaTool;
}());
export { MediaTool as M };
