/*!
 * Custom elements for Nanopore-Digital Web applications
 */
import { proxyCustomElement, HTMLElement } from '@stencil/core/internal/client';

const ctaCss = ":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}";

const NanoCta = /*@__PURE__*/ proxyCustomElement(class NanoCta extends HTMLElement {
    constructor() {
        super();
        this.__registerHost();
    }
    get host() { return this; }
    /** The semantic theme of the button. Defaults to primary / brand blue  */
    theme;
    /** Turn on the secondary style. Every theme also has a secondary style */
    secondary;
    /** The size of the button. Defaults to large */
    size;
    /** Show a loading spinner */
    loading;
    /**
     * A predefined icon to show. Defaults to no icon.
     * *note* Will be overruled if a `<nano-icon />` or `<svg />` is detected
     */
    icon;
    /** Predefined styles when displaying a number of CTAs together */
    group;
    componentWillLoad() {
        if (!this.host.querySelector('button, a, div')) {
            const button = document.createElement('button');
            button.classList.add('nano-internal-cta');
            button.type = 'button';
            this.host.childNodes.forEach((node) => {
                button.appendChild(node);
            });
            this.host.appendChild(button);
        }
    }
    static get style() { return ctaCss; }
}, [0, "nano-cta", {
        "theme": [513],
        "secondary": [516],
        "size": [513],
        "loading": [516],
        "icon": [513],
        "group": [513]
    }]);
function defineCustomElement() {
    if (typeof customElements === "undefined") {
        return;
    }
    const components = ["nano-cta"];
    components.forEach(tagName => { switch (tagName) {
        case "nano-cta":
            if (!customElements.get(tagName)) {
                customElements.define(tagName, NanoCta);
            }
            break;
    } });
}

export { NanoCta as N, defineCustomElement as d };
