// #region Imports
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { Disableable } from '../../../Behaviors/Disableable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Property } from '../../../Decorators/PropertyDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { IconElement } from '../../Media/Icon/IconElement';
import { ImageElement } from '../../Media/Image/ImageElement';
import { VideoElement } from '../../Media/Video/VideoElement';
import { AudioElement } from '../../Media/Audio/AudioElement';
import { thumbnailElementTemplate } from './ThumbnailElementTemplate';
import { MapElement } from '../../Media/Map/MapElement';
import { thumbnailElementCosmopolitanStyle } from './Themes/ThumbnailElement.Cosmopolitan';
import { thumbnailElementJoyStyle } from './Themes/ThumbnailElement.Joy';
import { thumbnailElementMemphisStyle } from './Themes/ThumbnailElement.Memphis';
// #endregion
/**
 * Thumbnail - A versatile media preview component that displays images, videos, audio, maps, or fallback icons.
 *
 * @description
 * The Thumbnail component provides a unified interface for displaying different types of media previews
 * in a consistent size and layout. It automatically renders the appropriate media element based on the
 * preview type (image, video, audio, map) and falls back to an icon for unsupported content types. This
 * makes it ideal for file managers, media galleries, attachment lists, and any scenario where diverse
 * content types need uniform visual representation.
 *
 * @name Thumbnail
 * @element mosaik-thumbnail
 * @category Primitives
 *
 * @csspart media - The media container element (applies to all media types)
 * @csspart image - The image media element
 * @csspart video - The video media element
 * @csspart audio - The audio media element
 * @csspart map - The map media element
 *
 * @dependency {ImageElement} - Image display component for image previews
 * @dependency {VideoElement} - Video display component for video previews
 * @dependency {AudioElement} - Audio display component for audio previews
 * @dependency {MapElement} - Map display component for location previews
 * @dependency {IconElement} - Icon display component for fallback content
 *
 * @example
 * Image thumbnail:
 * ```html
 * <mosaik-thumbnail id="imgThumb"></mosaik-thumbnail>
 * <script>
 *   const thumb = document.querySelector('#imgThumb');
 *   thumb.preview = {
 *     type: 'image',
 *     url: 'photo.jpg',
 *     alt: 'Vacation photo'
 *   };
 * </script>
 * ```
 *
 * @example
 * Video thumbnail with poster:
 * ```html
 * <mosaik-thumbnail id="vidThumb"></mosaik-thumbnail>
 * <script>
 *   const thumb = document.querySelector('#vidThumb');
 *   thumb.preview = {
 *     type: 'video',
 *     url: 'presentation.mp4',
 *     poster: 'poster.jpg'
 *   };
 * </script>
 * ```
 *
 * @example
 * Map location thumbnail:
 * ```html
 * <mosaik-thumbnail id="mapThumb"></mosaik-thumbnail>
 * <script>
 *   const thumb = document.querySelector('#mapThumb');
 *   thumb.preview = {
 *     type: 'map',
 *     latitude: 40.7128,
 *     longitude: -74.0060,
 *     zoom: 12,
 *     provider: 'openstreetmap',
 *     label: 'New York City'
 *   };
 * </script>
 * ```
 *
 * @example
 * Audio file thumbnail:
 * ```html
 * <mosaik-thumbnail id="audioThumb"></mosaik-thumbnail>
 * <script>
 *   const thumb = document.querySelector('#audioThumb');
 *   thumb.preview = {
 *     type: 'audio',
 *     url: 'podcast.mp3'
 *   };
 * </script>
 * ```
 *
 * @example
 * Disabled thumbnail:
 * ```html
 * <mosaik-thumbnail id="disabledThumb" disabled></mosaik-thumbnail>
 * <script>
 *   document.querySelector('#disabledThumb').preview = {
 *     type: 'image',
 *     url: 'unavailable.jpg'
 *   };
 * </script>
 * ```
 *
 * @public
 */
let ThumbnailElement = class ThumbnailElement extends Themeable(Disableable(CustomElement)) {
    // #region Fields
    _preview;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._preview = null;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the natural tag name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-thumbnail';
    }
    /**
     * Gets or sets the `file` property.
     *
     * @public
     */
    get preview() {
        return this._preview;
    }
    set preview(value) {
        if (this._preview !== value) {
            this._preview = value;
            this.requestUpdate('preview');
        }
    }
    /**
     * Gets the `kind` property.
     * The `kind` property represents the kind of preview to display.
     *
     * @public
     * @readonly
     */
    get kind() {
        return this._preview?.type ?? 'other';
    }
};
__decorate([
    Property({ type: Object }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], ThumbnailElement.prototype, "preview", null);
ThumbnailElement = __decorate([
    Component({
        selector: 'mosaik-thumbnail',
        template: thumbnailElementTemplate,
        themes: {
            joy: thumbnailElementJoyStyle,
            memphis: thumbnailElementMemphisStyle,
            cosmopolitan: thumbnailElementCosmopolitanStyle
        },
        imports: [
            ImageElement,
            VideoElement,
            AudioElement,
            MapElement,
            IconElement
        ]
    }),
    __metadata("design:paramtypes", [])
], ThumbnailElement);
export { ThumbnailElement };
//# sourceMappingURL=ThumbnailElement.js.map