// Stencil
import { h } from "@stencil/core";
// Tools
import { MarkdownTool } from '../../../tools/markdown-tool';
import { MediaTool } from '../../../tools/media-tool';
export class GeneralAudioContent {
    constructor() {
        // Props
        this.audioImage = [];
        this.audioTitle = '';
        this.audioSubtitle = '';
        this.audioSource = [];
        this.script = '';
        // States
        this.sourceId = 'id_' + (Math.random() * 1000000);
    }
    ////////////////////////////////////////////////////////////////
    // Render
    ////////////////////////////////////////////////////////////////
    render() {
        const speakerImage = this.thumbnail || 'https://wallpapersprime.com/wp-content/uploads/iPhone-6-Plus-Red-Lotus-Flower-Retina-Wallpaper.jpg';
        return (h("div", { class: 'full-container' },
            h("div", { class: 'image-container', style: { backgroundImage: 'url(' + MediaTool.imageXL(this.audioImage) + ')' } },
                h("div", { class: 'audio-container' },
                    h("div", { class: 'info-container' },
                        h("div", { class: 'info-photo', style: { backgroundImage: 'url(' + speakerImage + ')' } }),
                        h("div", { class: 'info-text' },
                            h("p", { class: 'audio-title' }, this.audioTitle),
                            h("p", { class: 'audio-subtitle' }, this.audioSubtitle))),
                    h("div", { class: 'audio-player' },
                        h("mini-audio-player", { contentId: this.sourceId, src: MediaTool.audio(this.audioSource) })))),
            h("div", { class: 'text-container', innerHTML: MarkdownTool.render(this.script) })));
    }
    static get is() { return "general-audio-content"; }
    static get originalStyleUrls() { return {
        "$": ["general-audio-content.scss"]
    }; }
    static get styleUrls() { return {
        "$": ["general-audio-content.css"]
    }; }
    static get properties() { return {
        "audioImage": {
            "type": "unknown",
            "mutable": false,
            "complexType": {
                "original": "MediaElement[]",
                "resolved": "MediaElement[]",
                "references": {
                    "MediaElement": {
                        "location": "import",
                        "path": "../../../models/media/media-model"
                    }
                }
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "defaultValue": "[]"
        },
        "audioTitle": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "audio-title",
            "reflect": false,
            "defaultValue": "''"
        },
        "audioSubtitle": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "audio-subtitle",
            "reflect": false,
            "defaultValue": "''"
        },
        "audioSource": {
            "type": "unknown",
            "mutable": false,
            "complexType": {
                "original": "MediaElement[]",
                "resolved": "MediaElement[]",
                "references": {
                    "MediaElement": {
                        "location": "import",
                        "path": "../../../models/media/media-model"
                    }
                }
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "defaultValue": "[]"
        },
        "thumbnail": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "thumbnail",
            "reflect": false
        },
        "script": {
            "type": "string",
            "mutable": false,
            "complexType": {
                "original": "string",
                "resolved": "string",
                "references": {}
            },
            "required": false,
            "optional": false,
            "docs": {
                "tags": [],
                "text": ""
            },
            "attribute": "script",
            "reflect": false,
            "defaultValue": "''"
        }
    }; }
    static get states() { return {
        "sourceId": {}
    }; }
}
