// #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 audio - The media audio part.
 * @csspart media image - The media image part.
 * @csspart media map - The media map part.
 * @csspart media other - The media other part.
 * @csspart media video - The media video part.
 *
 * @cssprop {String} --thumbnail-font-family - The font family CSS custom property.
 * @cssprop {String} --thumbnail-font-letter-spacing - The font letter spacing CSS custom property.
 * @cssprop {String} --thumbnail-font-line-height - The font line height CSS custom property.
 * @cssprop {String} --thumbnail-font-size - The font size CSS custom property.
 * @cssprop {String} --thumbnail-font-text-decoration - The font text decoration CSS custom property.
 * @cssprop {String} --thumbnail-font-text-transform - The font text transform CSS custom property.
 * @cssprop {String} --thumbnail-font-weight - The font weight CSS custom property.
 * @cssprop {String} --thumbnail-gap - The gap CSS custom property.
 * @cssprop {String} --thumbnail-padding-bottom - The padding bottom CSS custom property.
 * @cssprop {String} --thumbnail-padding-left - The padding left CSS custom property.
 * @cssprop {String} --thumbnail-padding-right - The padding right CSS custom property.
 * @cssprop {String} --thumbnail-padding-top - The padding top CSS custom property.
 * @cssprop {String} --thumbnail-shadow - The shadow CSS custom property.
 * @cssprop {String} --thumbnail-shadow-blur - The shadow blur CSS custom property.
 * @cssprop {String} --thumbnail-shadow-color - The shadow color CSS custom property.
 * @cssprop {String} --thumbnail-shadow-offset-x - The shadow offset x CSS custom property.
 * @cssprop {String} --thumbnail-shadow-offset-y - The shadow offset y CSS custom property.
 * @cssprop {String} --thumbnail-shadow-spread - The shadow spread CSS custom property.
 * @cssprop {String} --thumbnail-transition-duration - The transition duration CSS custom property.
 * @cssprop {String} --thumbnail-transition-mode - The transition mode CSS custom property.
 * @cssprop {String} --thumbnail-transition-property - The transition property CSS custom property.
 * @cssprop {String} --thumbnail-translate - The translate CSS custom property.
 *
 * @dependency mosaik-audio - The Audio element.
 * @dependency mosaik-image - The Image element.
 * @dependency mosaik-map - The Map element.
 * @dependency mosaik-video - The Video element.
 *
 * @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>
 * ```
 *
 * @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