import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
import { L as Lang } from './lang.js';
import { k as getMeta, t as tinyMDtoHTML } from './helpers.js';
import { a as axios } from './axios.js';
import { d as defineCustomElement$j } from './component2.js';
import { d as defineCustomElement$i } from './component3.js';
import { d as defineCustomElement$h } from './component5.js';
import { d as defineCustomElement$g } from './component6.js';
import { d as defineCustomElement$f } from './component7.js';
import { d as defineCustomElement$e } from './component10.js';
import { d as defineCustomElement$d } from './component18.js';
import { d as defineCustomElement$c } from './component11.js';
import { d as defineCustomElement$b } from './component12.js';
import { d as defineCustomElement$a } from './component-image.js';
import { d as defineCustomElement$9 } from './component.js';
import { d as defineCustomElement$8 } from './component15.js';
import { d as defineCustomElement$7 } from './component-image2.js';
import { d as defineCustomElement$6 } from './components.js';
import { d as defineCustomElement$5 } from './component13.js';
import { d as defineCustomElement$4 } from './component-tab.js';
import { d as defineCustomElement$3 } from './component19.js';
import { d as defineCustomElement$2 } from './component14.js';

const styleCss = ".gallery-picker .card-body{padding-bottom:0}.gallery-picker .results{display:block;clear:both}.gallery-picker .media-gallery{display:block;max-height:calc(100vh - 265px);overflow-y:auto;padding:4px 4px 0}.gallery-picker .items{display:grid;width:100%;position:relative;grid-template-columns:repeat(5, 1fr);gap:1rem;margin-bottom:1rem}.gallery-picker x-input-image{width:8rem;height:8rem;min-width:8rem;min-height:8rem;padding:0;border-radius:0.5rem;border:1px dashed var(--color-border-tinted);background-color:var(--color-white);-webkit-transition:0.3s;transition:0.3s;color:var(--color-text);cursor:pointer;margin:0 auto}.gallery-picker x-input-image:after,.gallery-picker x-input-image:before{display:none}.is-dark-mode .gallery-picker x-input-image{background-color:var(--color-dark);border:1px dashed var(--color-border-shaded)}.gallery-picker x-input-image .upload-zone{width:8rem;height:8rem;top:0;right:0;left:0;bottom:0;padding:0.5rem}.gallery-picker x-input-image:hover{border-color:var(--color-primary);-webkit-box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb), 0.1);box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb), 0.1);cursor:pointer}.gallery-picker x-gallery-image{position:relative;display:inline-block;width:8rem;height:8rem;margin:0 auto;border-radius:0.5rem;background-position:center;background-size:cover;border:1px solid var(--color-border-tinted, #d9d8db);background-color:var(--color-white, #FFFFFF);-webkit-transition:0.3s;transition:0.3s}.is-dark-mode .gallery-picker x-gallery-image{background-color:var(--color-dark, #1F1F1F) !important;border:1px solid var(--color-dark-tint, #414141);color:var(--color-light, #FEFEFE)}.is-mobile .gallery-picker x-gallery-image .actions a{display:none}@media (hover: hover) and (pointer: fine){.gallery-picker x-gallery-image:hover{border-color:var(--color-primary, #4275F2);-webkit-box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.1);box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.1);cursor:pointer}.gallery-picker x-gallery-image:hover.selected{-webkit-box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 4px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25) !important;box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 4px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25) !important}.gallery-picker x-gallery-image:hover .actions{-webkit-transform:translateX(0px);transform:translateX(0px);opacity:1;visibility:visible;pointer-events:initial}}@media (hover: none) and (pointer: coarse){.gallery-picker x-gallery-image.selected .actions{-webkit-transform:translateX(0px);transform:translateX(0px);opacity:1;visibility:visible;pointer-events:initial}}.gallery-picker x-gallery-image.selected{border-color:var(--color-primary, #4275F2);-webkit-box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25);box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25)}.is-dark-mode .gallery-picker x-gallery-image.selected{-webkit-box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-black-rgb, 0, 0, 0), 0.25);box-shadow:0px 12px 10px -8px rgba(0, 0, 0, 0.1), 0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 1), 0 8px 15px 0 rgba(var(--color-black-rgb, 0, 0, 0), 0.25)}.gallery-picker x-gallery-image.selected .checkmark{background-color:var(--color-primary, #4275F2);-webkit-transform:translateY(0px);transform:translateY(0px);opacity:1;-webkit-box-shadow:0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25);box-shadow:0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.25)}.is-dark-mode .gallery-picker x-gallery-image.selected .checkmark{-webkit-box-shadow:0 8px 15px 0 rgba(var(--color-black-rgb, 0, 0, 0), 0.25) !important;box-shadow:0 8px 15px 0 rgba(var(--color-black-rgb, 0, 0, 0), 0.25) !important}.gallery-picker x-gallery-image.selected .checkmark:after{display:block}.gallery-picker x-gallery-image.loading{cursor:not-allowed;background-image:none !important;pointer-events:none}.gallery-picker x-gallery-image.loading .actions{display:none !important}.gallery-picker x-gallery-image .loading-indicator{width:2em;height:2em;position:absolute;color:inherit;display:inline-block;-webkit-box-sizing:content-box;box-sizing:content-box;-webkit-animation:cycle 0.8s infinite linear;animation:cycle 0.8s infinite linear;padding:0px;top:calc(50% - 1em);left:calc(50% - 1em)}.gallery-picker x-gallery-image .loading-indicator:after{content:\" \";display:block;width:4em;height:4em;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transform-origin:0em 0em;transform-origin:0em 0em;-webkit-transform:translateZ(0) scale(0.5);transform:translateZ(0) scale(0.5);-webkit-backface-visibility:hidden;backface-visibility:hidden;border-radius:50%;border:0.3em solid currentColor;border-left-color:transparent}.gallery-picker x-gallery-image .actions{display:block;position:absolute;bottom:0.25rem;right:0.25rem;-webkit-transition:0.3s;transition:0.3s;-webkit-transform:translateX(-30px);transform:translateX(-30px);opacity:0;visibility:hidden}.gallery-picker x-gallery-image .actions>button,.gallery-picker x-gallery-image .actions>a{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;background-color:rgba(0, 0, 0, 0.5);border:1px solid transparent;width:2rem;height:2rem;border-radius:5px;margin-top:3px;-webkit-transition:0.3s;transition:0.3s}.gallery-picker x-gallery-image .actions>button x-icon,.gallery-picker x-gallery-image .actions>a x-icon{color:white;display:inline-block;-webkit-transition:0.3s;transition:0.3s}.gallery-picker x-gallery-image .actions>button:hover,.gallery-picker x-gallery-image .actions>a:hover{background-color:rgba(0, 0, 0, 0.7);-webkit-box-shadow:0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.1), 0px 0px 0px 1px var(--color-primary, #4275F2);box-shadow:0px 0px 0px 3px rgba(var(--color-primary-rgb, 66, 117, 242), 0.3), 0 8px 15px 0 rgba(var(--color-primary-rgb, 66, 117, 242), 0.1), 0px 0px 0px 1px var(--color-primary, #4275F2)}.gallery-picker x-gallery-image .actions>button:hover x-icon,.gallery-picker x-gallery-image .actions>a:hover x-icon{-webkit-transform:scale(1.1);transform:scale(1.1)}.gallery-picker x-gallery-image .checkmark{position:absolute;bottom:-0.625rem;left:-0.625rem;height:1.6rem;width:1.6rem;border-radius:50%;-webkit-transition:0.3s;transition:0.3s;-webkit-transform:translateY(10px);transform:translateY(10px);opacity:0;z-index:5}.gallery-picker x-gallery-image .checkmark:after{content:\"\";position:absolute;display:none;left:8px;top:4px;width:5px;height:10px;border:solid white;border-width:0 3px 3px 0;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-box-sizing:content-box !important;box-sizing:content-box !important}@-webkit-keyframes onDrag{from{-webkit-transform:translateY(-3px);transform:translateY(-3px)}to{-webkit-transform:translateY(3px);transform:translateY(3px)}}@keyframes onDrag{from{-webkit-transform:translateY(-3px);transform:translateY(-3px)}to{-webkit-transform:translateY(3px);transform:translateY(3px)}}@media screen and (max-width: 680px){.gallery-picker .items{gap:0.5rem}}@media screen and (max-width: 650px){.image-gallery-modal .modal-slot{max-width:38rem !important}.gallery-picker .items{grid-template-columns:repeat(4, 1fr);gap:1rem}}@media screen and (max-width: 536px){.gallery-picker .items{grid-template-columns:repeat(5, 1fr)}.gallery-picker .items x-input-image{width:5rem;height:5rem;min-width:5rem;min-height:5rem}.gallery-picker .items x-input-image .upload-zone{width:5rem;height:5rem}.gallery-picker .items x-input-image .upload-zone>p{display:none}.gallery-picker .items x-gallery-image{width:5rem;height:5rem}}@media screen and (max-width: 452px){.gallery-picker .items{gap:0.5rem}}@media screen and (max-width: 422px){.gallery-picker .items{grid-template-columns:repeat(4, 1fr);gap:1rem}}@media screen and (max-width: 370px){.gallery-picker .items{gap:0.5rem}}@media screen and (max-width: 346px){.gallery-picker .items{grid-template-columns:repeat(4, 1fr)}}@media screen and (max-width: 336px){.gallery-picker .items{grid-template-columns:repeat(3, 1fr)}}";
const XGalleryStyle0 = styleCss;

const GALLERY_ROUTE = '/services/media';
const XGallery$1 = /*@__PURE__*/ proxyCustomElement(class XGallery extends HTMLElement {
    constructor() {
        super();
        this.__registerHost();
        this.onSelected = createEvent(this, "selected", 3);
        this.onCanceled = createEvent(this, "canceled", 3);
        this.appendHeaders = {};
        this.endpoint = '';
        this.loading = false;
        this.errorMessage = undefined;
        this.selectedMedia = undefined;
        this.galleryCollection = [];
        this.galleryPage = 1;
        this.galleryResultsCount = 0;
        this.galleryHasMore = false;
        this.galleryUploadProgress = undefined;
        this.generatedCollection = [];
    }
    /**
     * Call the gallery window
     */
    async load(cropperOptions) {
        this.resetData();
        this.loadGalleryAssets();
        this.loadGeneratedAssets();
        cropperOptions && this.inputImage.setCropperOptions(cropperOptions);
        this.modal.open();
    }
    /**
     * Add initial values to components
     */
    resetData() {
        this.loading = false;
        this.errorMessage = null;
        this.galleryCollection = [];
        this.galleryPage = 1;
        this.galleryResultsCount = 0;
        this.galleryHasMore = false;
        this.generatedCollection = [];
        this.selectedMedia = null;
    }
    /**
     * Axios response error capture
     */
    catchRequestFail(err) {
        if (err.response) {
            let data = err.response.data;
            return data.message ? data.message : `Response ${err.response.status}`;
        }
        else if (err.request) {
            return err.request;
        }
        else {
            return err.message;
        }
    }
    /**
     * Get element by UUID
     */
    getIndexCollectionByUUID(collection, uuid) {
        return collection.findIndex(x => x.uuid === uuid);
    }
    /**
     * Loading all images saved for actual user
     */
    loadGalleryAssets(page = 1) {
        this.errorMessage = null;
        this.loading = true;
        axios({
            method: 'GET',
            url: `${this.endpoint}${GALLERY_ROUTE}/gallery?page=${page}`,
            headers: Object.assign(Object.assign({}, this.appendHeaders), { 'X-CSRF-TOKEN': getMeta('csrf-token') })
        })
            .then(response => {
            return response.data.data;
        })
            .then(data => {
            this.galleryPage = page;
            if (page > 1) {
                this.galleryCollection = this.galleryCollection.concat(data.items);
            }
            else {
                this.galleryCollection = data.items;
            }
            this.galleryHasMore = data.has_more;
            this.galleryResultsCount = data.total;
        })
            .catch(err => {
            this.errorMessage = this.catchRequestFail(err);
        })
            .finally(() => {
            this.loading = false;
        });
    }
    /**
     * Loading last generated images for actual user
     */
    loadGeneratedAssets() {
        this.errorMessage = null;
        this.loading = true;
        axios({
            method: 'GET',
            url: `${this.endpoint}${GALLERY_ROUTE}/generate`,
            headers: Object.assign(Object.assign({}, this.appendHeaders), { 'X-CSRF-TOKEN': getMeta('csrf-token') })
        })
            .then(response => {
            return response.data.data;
        })
            .then(data => {
            this.generatedCollection = data.items;
        })
            .catch(err => {
            this.errorMessage = this.catchRequestFail(err);
        })
            .finally(() => {
            this.loading = false;
        });
    }
    /**
     * Select the element ready for choose
     */
    onSelectMedia(media) {
        this.selectedMedia = media;
    }
    /**
     * Upload image and return file
     */
    onUploadImage(e) {
        if (this.loading) {
            return;
        }
        this.galleryCollection.unshift({
            uuid: 'upload-image',
            url: URL.createObjectURL(e.detail),
            type: 'image',
            loading: true,
        });
        this.errorMessage = null;
        this.galleryUploadProgress = null;
        this.loading = true;
        const data = new FormData();
        data.append('image', e.detail);
        axios({
            method: 'POST',
            url: `${this.endpoint}${GALLERY_ROUTE}/gallery`,
            data: data,
            headers: Object.assign(Object.assign({}, this.appendHeaders), { 'X-CSRF-TOKEN': getMeta('csrf-token') }),
            onUploadProgress: progressEvent => {
                this.galleryUploadProgress = Math.round((progressEvent.loaded * 100) / progressEvent.total);
            }
        })
            .then(response => {
            return response.data.data;
        })
            .then(data => {
            const index = this.getIndexCollectionByUUID(this.galleryCollection, 'upload-image');
            this.galleryCollection[index] = data;
        })
            .catch(err => {
            this.errorMessage = this.catchRequestFail(err);
        })
            .finally(() => {
            this.loading = false;
            this.galleryUploadProgress = null;
        });
    }
    /**
     * Delete image and return confirmation
     */
    onDeleteImage(uuid) {
        this.errorMessage = null;
        this.loading = true;
        axios({
            method: 'DELETE',
            url: `${this.endpoint}${GALLERY_ROUTE}/gallery?uuid=${uuid}`,
            headers: Object.assign(Object.assign({}, this.appendHeaders), { 'X-CSRF-TOKEN': getMeta('csrf-token') })
        })
            .then(response => {
            return response.data.data;
        })
            .then(data => {
            const index = this.getIndexCollectionByUUID(this.galleryCollection, data.uuid);
            if (index != -1) {
                this.galleryCollection.splice(index, 1);
                this.selectedMedia = null;
            }
        })
            .catch(err => {
            this.errorMessage = this.catchRequestFail(err);
        })
            .finally(() => {
            this.loading = false;
        });
    }
    /**
     * Send IA prompt and return image result
     */
    onPromptImage(prompt) {
        if (this.loading) {
            return;
        }
        this.generatedCollection.unshift({
            uuid: 'generate-image',
            url: '',
            type: 'image',
            loading: true,
        });
        this.errorMessage = null;
        this.loading = true;
        this.promptInput.setAttribute('disabled', 'disabled');
        const data = new FormData();
        data.append('prompt', prompt);
        axios({
            method: 'POST',
            url: `${this.endpoint}${GALLERY_ROUTE}/generate`,
            data: data,
            headers: Object.assign(Object.assign({}, this.appendHeaders), { 'X-CSRF-TOKEN': getMeta('csrf-token') })
        })
            .then(response => {
            return response.data.data;
        })
            .then(data => {
            const index = this.getIndexCollectionByUUID(this.generatedCollection, 'generate-image');
            this.generatedCollection[index] = data;
        })
            .catch(err => {
            this.generatedCollection.shift();
            this.errorMessage = this.catchRequestFail(err);
        })
            .finally(() => {
            this.loading = false;
            this.promptInput.removeAttribute('disabled');
        });
    }
    /**
     * On window finish selection of media element
     */
    onFinishSelectMedia(media) {
        this.modal.close();
        setTimeout(() => {
            this.resetData();
        }, 500);
        media ? this.onSelected.emit(media) : this.onCanceled.emit();
    }
    /**
     * Render the component
     */
    render() {
        var _a;
        return (h(Host, { key: '4034131b240e93ad7dd41bd307a3ceac6bb160c0' }, h("x-modal", { key: '173c10aa8dbaa8318bebea6d2324482134016fa4', class: "image-gallery-modal", ref: el => (this.modal = el), closable: false, size: "big" }, h("x-card", { key: '5aa146c11695465daedb18dfa46f74bca2fb26e7', icon: "image-gallery", "icon-color": "primary", class: "gallery-picker" }, h("x-tabs", { key: '1990449643300d31b092af80bb9bc8182cbbd325' }, h("x-tab", { key: '023effe494279f0bbc4de22b4473854590f43c27', label: Lang.get('gallery.gallery'), badge: ((_a = this.selectedMedia) === null || _a === void 0 ? void 0 : _a.type) == 'image' ? 1 : null }, h("div", { key: '63e3a10ba7338222c9ba23738b6e06d1f97d51c0', class: "items" }, h("x-input-image", { key: '67c9053876c405116cf64435da4eea04061ce4a4', ref: el => this.inputImage = el, "without-preview": true, onFile: e => this.onUploadImage(e) }, h("x-cropper", { key: '46baaa4957a0db95018bc36e99bbac1d8e8371d7' })), this.galleryCollection.map(item => {
            var _a;
            return (h("x-gallery-image", { url: item.url, key: item.uuid, uuid: item.uuid, selected: ((_a = this.selectedMedia) === null || _a === void 0 ? void 0 : _a.uuid) == item.uuid, loading: item.loading, onClick: () => this.onSelectMedia(item) }, h("a", { href: item.url, download: true, title: Lang.get('gallery.download') }, h("x-icon", { name: "download" })), h("button", { onClick: () => this.onDeleteImage(item.uuid), title: Lang.get('gallery.delete') }, h("x-icon", { name: "trash" }))));
        })), this.galleryHasMore && !this.loading && (h("x-divider", { key: 'a2ae205a07c73b31527dc747bfe19ee4cf1b1166', align: "center" }, h("a", { key: '6a6a9deb4adf4fbde677e580bd318fa0a1e15716', href: "#", class: { disabled: this.loading }, onClick: () => this.loadGalleryAssets(this.galleryPage + 1) }, Lang.get('gallery.view-more')))), !!this.galleryResultsCount && !this.loading && (h("div", { key: 'e80ffca6eac64aef143a2e959fea986eff9855c7', class: "results mt-4", innerHTML: tinyMDtoHTML(Lang.get('gallery.gallery-results', {
                length: this.galleryCollection.length,
                total: this.galleryResultsCount,
            })) })), this.errorMessage && (h("x-alert", { key: '5c252ae82688109aee3d4d38f0abfe17917c0676', small: true, color: "danger", icon: "danger" }, this.errorMessage)), this.loading && h("x-progress", { key: '49657406edc2fa81a35ba60d34d90fdfc5c47111', loading: !this.galleryUploadProgress, value: this.galleryUploadProgress })), h("x-tab", { key: '24acc4d0c4ce4b8a201b314eeafc26604963ee4d', label: Lang.get('gallery.generate') }, h("x-input", { key: '12aa11b5ab3d9929e14f49ac25276b0da1ed0b34', ref: el => (this.promptInput = el), placeholder: Lang.get('gallery.generate-placeholder') }, h("x-icon", { key: '97b2cd145fece42b49156f3a918f372e343835fc', name: "chatgpt", size: "24px", slot: "indicator" }), h("x-button", { key: '1e9b30ecb3076f29abcfb5463c5c1ec23a63bc26', icon: "right", slot: "buttons", onClick: () => this.onPromptImage(String(this.promptInput.value)) })), this.generatedCollection.length > 0 && h("x-divider", { key: '4f34d54bbe5e0d3016c1e46727eb01322cc7ddf0', class: "my-4" }, Lang.get('gallery.generated-images')), this.generatedCollection.length > 0 && (h("div", { key: 'a71f47a592cb1edcf6c6cfd377698162af133d96', class: "items" }, this.generatedCollection.map(item => {
            var _a;
            return (h("x-gallery-image", { url: item.url, key: item.uuid, uuid: item.uuid, selected: ((_a = this.selectedMedia) === null || _a === void 0 ? void 0 : _a.uuid) == item.uuid, loading: item.loading, onClick: () => this.onSelectMedia(item) }, h("a", { href: item.url, download: true, target: "_blank", title: Lang.get('gallery.download') }, h("x-icon", { name: "download" })), h("button", { onClick: () => this.onPromptImage(item.prompt), title: Lang.get('gallery.reprompt', { prompt: item.prompt }) }, h("x-icon", { name: "sparkling" }))));
        }))), this.errorMessage && (h("x-alert", { key: '29a64480eb6249bf594a807b2334151a276ce0cd', small: true, class: "mt-3", color: "danger", icon: "danger" }, this.errorMessage)), this.loading && h("x-progress", { key: 'e0a926962d4c39edc4d2c367ff11a5f8f7ed65ce', loading: true })))), h("x-dock", { key: '6eb989cb4e503da316af0de547373f943b59f441', block: true }, h("x-button", { key: 'b76f486e2542e173bed8e40582c491d0f6b6307e', icon: "left", onClick: () => this.onFinishSelectMedia() }, Lang.get('gallery.back')), h("x-button", { key: 'a094bb50c8a6e69dedb9d75ac6a5cb02929a6d17', icon: "check", color: "primary", disabled: !this.selectedMedia, onClick: () => this.onFinishSelectMedia(this.selectedMedia) }, Lang.get('gallery.select'))))));
    }
    static get style() { return XGalleryStyle0; }
}, [0, "x-gallery", {
        "appendHeaders": [16],
        "endpoint": [1],
        "loading": [32],
        "errorMessage": [32],
        "selectedMedia": [32],
        "galleryCollection": [32],
        "galleryPage": [32],
        "galleryResultsCount": [32],
        "galleryHasMore": [32],
        "galleryUploadProgress": [32],
        "generatedCollection": [32],
        "load": [64]
    }]);
function defineCustomElement$1() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["x-gallery", "x-alert", "x-animate", "x-badge", "x-button", "x-card", "x-cropper", "x-divider", "x-dock", "x-dropdown", "x-gallery-image", "x-icon", "x-input", "x-input-image", "x-modal", "x-progress", "x-tab", "x-tabs", "x-tooltip"];
    components.forEach(tagName => { switch (tagName) {
        case "x-gallery":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, XGallery$1);
            }
            break;
        case "x-alert":
            if (!customElements.get(tagName)) {
                defineCustomElement$j();
            }
            break;
        case "x-animate":
            if (!customElements.get(tagName)) {
                defineCustomElement$i();
            }
            break;
        case "x-badge":
            if (!customElements.get(tagName)) {
                defineCustomElement$h();
            }
            break;
        case "x-button":
            if (!customElements.get(tagName)) {
                defineCustomElement$g();
            }
            break;
        case "x-card":
            if (!customElements.get(tagName)) {
                defineCustomElement$f();
            }
            break;
        case "x-cropper":
            if (!customElements.get(tagName)) {
                defineCustomElement$e();
            }
            break;
        case "x-divider":
            if (!customElements.get(tagName)) {
                defineCustomElement$d();
            }
            break;
        case "x-dock":
            if (!customElements.get(tagName)) {
                defineCustomElement$c();
            }
            break;
        case "x-dropdown":
            if (!customElements.get(tagName)) {
                defineCustomElement$b();
            }
            break;
        case "x-gallery-image":
            if (!customElements.get(tagName)) {
                defineCustomElement$a();
            }
            break;
        case "x-icon":
            if (!customElements.get(tagName)) {
                defineCustomElement$9();
            }
            break;
        case "x-input":
            if (!customElements.get(tagName)) {
                defineCustomElement$8();
            }
            break;
        case "x-input-image":
            if (!customElements.get(tagName)) {
                defineCustomElement$7();
            }
            break;
        case "x-modal":
            if (!customElements.get(tagName)) {
                defineCustomElement$6();
            }
            break;
        case "x-progress":
            if (!customElements.get(tagName)) {
                defineCustomElement$5();
            }
            break;
        case "x-tab":
            if (!customElements.get(tagName)) {
                defineCustomElement$4();
            }
            break;
        case "x-tabs":
            if (!customElements.get(tagName)) {
                defineCustomElement$3();
            }
            break;
        case "x-tooltip":
            if (!customElements.get(tagName)) {
                defineCustomElement$2();
            }
            break;
    } });
}

const XGallery = XGallery$1;
const defineCustomElement = defineCustomElement$1;

export { XGallery, defineCustomElement };
