'use strict';

var index = require('./index-BEF5cZxd.js');
var template = require('./template-Cj6PcLmR.js');
var props = require('./props-CPENhBnM.js');
var constants = require('./constants-z2ZSS2je.js');
var utils = require('./utils-NnC78QR3.js');
var sizes = require('./sizes-D5zsw2g5.js');
var helpers = require('./helpers-DmI-ZOAH.js');
require('./gov.log-C5EH15b_.js');
require('./colors-DgrrxjsX.js');

const TagSizes = utils.pick(sizes.Sizes, ['_XS', '_S', '_M']);
var TagType;
(function (TagType) {
    TagType["BOLD"] = "bold";
    TagType["SUBTLE"] = "subtle";
})(TagType || (TagType = {}));
const TagClass = {
    root: 'gov-tag',
};

const GovTag = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
        /**
         * Tag’s size.
         */
        this.size = TagSizes._S;
        /**
         * Style variation of the tag.
         */
        this.color = constants.ButtonColors.PRIMARY;
        /**
         * Expands the tag to fill 100% of the container width
         */
        this.expanded = false;
        this.h = template.govHost(this.host);
    }
    validateColor(newValue) {
        props.validateProp(constants.ButtonColors, newValue, TagClass.root);
    }
    validateSize(newValue) {
        props.validateProp(constants.ButtonSizes, newValue, TagClass.root);
    }
    componentWillLoad() {
        this.validateColor(this.color);
        this.validateSize(this.size);
    }
    render() {
        const iconStart = helpers.prepareIconFormat(this.iconStart);
        const iconEnd = helpers.prepareIconFormat(this.iconEnd);
        return (index.h(index.Host, { key: 'bb366b85a94d134d58766604e6410e17bed07adc', class: this.h.classes(TagClass.root), color: this.color, size: this.size, type: this.type }, index.h("span", { key: '963aa53926b6b65bbc155c349a119f46aabe59c8', class: "element" }, index.h("slot", { key: '3164cfa09970ac3e0f97df7265afd45a623b09aa', name: "icon-start" }, iconStart && index.h("gov-icon", { key: '335c0e5db0cb5a808c553bd4c9f6893d17a8fac9', type: iconStart.type, name: iconStart.name })), index.h("slot", { key: '9be29754dcefdaa37daee39befdc6a708e36324d' }), index.h("slot", { key: '6dffe882089838615e9fe451fc800b728885746a', name: "icon-end" }, iconEnd && index.h("gov-icon", { key: '415d8c03fefdf6281ae13668fb7b3aeaa572856e', type: iconEnd.type, name: iconEnd.name })))));
    }
    get host() { return index.getElement(this); }
    static get watchers() { return {
        "color": ["validateColor"],
        "size": ["validateSize"]
    }; }
};

exports.gov_tag = GovTag;
//# sourceMappingURL=gov-tag.entry.cjs.js.map

//# sourceMappingURL=gov-tag.cjs.entry.js.map