/*!
 * Custom elements for Nanopore-Digital Web applications
 */
'use strict';

var index = require('./index-DGttnXif.js');

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 = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    get host() { return index.getElement(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);
        }
    }
};
NanoCta.style = ctaCss;

exports.nano_cta = NanoCta;
