'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var vue = require('vue');
require('../../../utils/index.js');
var avatar = require('./avatar.js');
var createNamespace = require('../../../utils/create-namespace.js');

"use strict";
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{ name: "LlAvatar" },
  __name: "avatar",
  props: avatar.avatarProps,
  setup(__props) {
    const attrs = vue.useAttrs();
    const props = __props;
    const bem = createNamespace.createNamespace("avatar");
    const getSrc = vue.computed(() => props.src || props.defaultSrc || avatar.AVATAR_IMG);
    return (_ctx, _cache) => {
      const _component_ll_icon = vue.resolveComponent("ll-icon");
      const _component_a_avatar = vue.resolveComponent("a-avatar");
      return vue.openBlock(), vue.createBlock(_component_a_avatar, vue.mergeProps(vue.unref(attrs), {
        class: [vue.unref(bem).b(), props.isTransform ? vue.unref(bem).is("transform") : ""],
        src: _ctx.avatarType === "src" ? getSrc.value : ""
      }), vue.createSlots({
        default: vue.withCtx(() => [
          _ctx.avatarType === "text" ? vue.renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
            vue.createTextVNode(
              vue.toDisplayString(_ctx.text),
              1
              /* TEXT */
            )
          ]) : vue.createCommentVNode("v-if", true)
        ]),
        _: 2
        /* DYNAMIC */
      }, [
        _ctx.avatarType === "icon" ? {
          name: "icon",
          fn: vue.withCtx(() => [
            vue.createVNode(_component_ll_icon, {
              "icon-name": _ctx.icon,
              color: _ctx.iconColor || `var(--default-icon)`
            }, null, 8, ["icon-name", "color"])
          ]),
          key: "0"
        } : void 0
      ]), 1040, ["class", "src"]);
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=avatar.vue2.js.map
