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;
};
import { css, html, customElement, state } from '../../../../../external/lit/index.js';
import { UmbLitElement } from '../../../../core/lit-element/index.js';
import { UmbPackageRepository } from '../../../package/index.js';
let UmbPackagesMarketplaceSectionViewElement = class UmbPackagesMarketplaceSectionViewElement extends UmbLitElement {
    #packageRepository = new UmbPackageRepository(this);
    constructor() {
        super();
        this.#getMarketplaceUrl();
    }
    async #getMarketplaceUrl() {
        const configuration = await this.#packageRepository.configuration();
        this.observe(configuration, (configuration) => {
            this._marketplaceUrl = configuration.marketplaceUrl;
        }, '_observeConfiguration');
    }
    render() {
        if (!this._marketplaceUrl)
            return html `<div id="loader"><uui-loader></uui-loader></div>`;
        return html `
			<div id="container">
				<iframe
					src=${this._marketplaceUrl}
					title="Umbraco Marketplace"
					allowfullscreen
					allow="geolocation; autoplay; clipboard-write; encrypted-media">
				</iframe>
			</div>
		`;
    }
    static { this.styles = [
        css `
			:host {
				height: 100%;
				display: block;
			}

			#loader {
				height: 100%;
				display: flex;
				align-items: center;
				justify-content: center;
			}

			#container {
				height: 100%;
				display: flex;
				align-items: stretch;
			}

			iframe {
				width: 100%;
				height: 100%;
				overflow: hidden;
				border: none;
			}
		`,
    ]; }
};
__decorate([
    state()
], UmbPackagesMarketplaceSectionViewElement.prototype, "_marketplaceUrl", void 0);
UmbPackagesMarketplaceSectionViewElement = __decorate([
    customElement('umb-packages-marketplace-section-view')
], UmbPackagesMarketplaceSectionViewElement);
export { UmbPackagesMarketplaceSectionViewElement };
export default UmbPackagesMarketplaceSectionViewElement;
