import { __assign } from 'tslib';
import { withThemeableProps } from '../../useThemeable.js';
import { classNamesFunction } from '@uifabric-vue/utilities';
import Vue from 'vue';

var getClassNames = classNamesFunction();
var LinkBase = Vue.extend({
  name: "LinkBase",
  functional: true,
  props: __assign(__assign({}, withThemeableProps()), { as: { type: String, default: void 0 }, underline: { type: Boolean, default: false }, disabled: { type: Boolean, default: false }, href: { type: String, default: "" }, target: { type: String, default: void 0 } }),
  render: function(h, ctx) {
    var _a = ctx.props, as = _a.as, target = _a.target, theme = _a.theme, className = _a.className, styles = _a.styles, href = _a.href, disabled = _a.disabled, underline = _a.underline;
    var classNames = getClassNames(styles, {
      theme: theme,
      className: className,
      isButton: !href,
      isDisabled: disabled,
      isUnderlined: underline
    });
    var rootType = as || (href ? "a" : "button");
    return h(rootType, __assign(__assign({}, ctx.data), { class: classNames.root, attrs: __assign(__assign(__assign({}, rootType === "a" && {
      target: target,
      href: disabled ? void 0 : href
    }), rootType === "button" && {
      type: "button",
      disabled: disabled
    }), ctx.data.attrs) }), ctx.children);
  }
});

export { LinkBase };
