'use strict';

var BadgeStyle = require('primevue/badge/style');
var BaseComponent = require('primevue/basecomponent');
var vue = require('vue');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var BadgeStyle__default = /*#__PURE__*/_interopDefaultLegacy(BadgeStyle);
var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);

var script$1 = {
  name: 'BaseBadge',
  "extends": BaseComponent__default["default"],
  props: {
    label: {
      type: [String, Number],
      "default": null
    },
    icon: {
      type: String,
      "default": null
    },
    iconPos: {
      type: String,
      "default": 'left'
    },
    iconClass: {
      type: String,
      "default": null
    },
    variant: {
      type: String,
      "default": null
    },
    size: {
      type: String,
      "default": null
    }
  },
  style: BadgeStyle__default["default"],
  provide: function provide() {
    return {
      $parentInstance: this
    };
  }
};

var script = {
  name: 'Badge',
  "extends": script$1,
  inheritAttrs: false,
  methods: {
    getPTOptions: function getPTOptions(key) {
      return this.ptm(key, {
        context: {
          disabled: this.disabled
        }
      });
    }
  },
  computed: {
    disabled: function disabled() {
      return this.$attrs.disabled || this.$attrs.disabled === '';
    },
    hasIcon: function hasIcon() {
      return this.icon || this.$slots.icon;
    }
  }
};

var _hoisted_1 = ["disabled", "data-pc-variant"];
function render(_ctx, _cache, $props, $setup, $data, $options) {
  var _component_WecgIcon = vue.resolveComponent("WecgIcon");
  return vue.openBlock(), vue.createElementBlock("span", vue.mergeProps({
    "class": _ctx.cx('root'),
    disabled: $options.disabled
  }, $options.getPTOptions('root'), {
    "data-pc-variant": _ctx.variant
  }), [_ctx.icon ? vue.renderSlot(_ctx.$slots, "icon", {
    key: 0,
    "class": vue.normalizeClass([_ctx.cx('icon')])
  }, function () {
    return [vue.createVNode(_component_WecgIcon, vue.mergeProps({
      icon: _ctx.icon,
      "class": _ctx.cx('iconClass')
    }, _ctx.ptm('icon'), {
      label: _ctx.icon,
      size: _ctx.size,
      variant: _ctx.variant,
      disabled: $options.disabled
    }), null, 16, ["icon", "class", "label", "size", "variant", "disabled"])];
  }) : vue.createCommentVNode("", true), vue.createElementVNode("span", vue.mergeProps({
    "class": _ctx.cx('label')
  }, _ctx.ptm('label')), vue.toDisplayString(_ctx.label || ' '), 17)], 16, _hoisted_1);
}

script.render = render;

module.exports = script;
