import { defineComponent, openBlock, createElementBlock, createElementVNode, createVNode, unref, normalizeStyle, withCtx, renderSlot, toDisplayString } from 'vue';
import { MeResourceImage } from '../../resource-image/index.mjs';

"use strict";
const _hoisted_1 = { style: { "display": "flex", "align-items": "center", "cursor": "pointer" } };
const _hoisted_2 = { style: { "display": "flex", "justify-content": "center", "align-items": "center", "height": "100%" } };
const _hoisted_3 = ["src"];
const _hoisted_4 = { style: { "margin-left": "10px" } };
const _hoisted_5 = { style: { "font-weight": "bold", "line-height": "24px" } };
const _hoisted_6 = { style: { "font-size": "11px", "color": "#909399", "line-height": "24px" } };
const __default__ = defineComponent({
  name: "me-avatar"
});
var script = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    defaultImage: { type: String, required: false, default: "https://resource.mini-enjoy.com/saas/images/avatar-visitor.png" },
    size: { type: String, required: false, default: "44px" },
    image: { type: String, required: true },
    name: { type: String, required: false },
    desc: { type: String, required: false },
    style: { type: Object, required: false }
  },
  setup(__props) {
    const props = __props;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        createElementVNode("div", null, [
          createVNode(unref(MeResourceImage), {
            style: normalizeStyle([{ "border-radius": "50%", "border": "2px solid #fff", "box-shadow": "0 2px 8px #0000000a", "overflow": "hidden" }, [{ width: __props.size, height: __props.size }, __props.style]]),
            modelValue: __props.image
          }, {
            error: withCtx(() => [
              renderSlot(_ctx.$slots, "error", {}, () => [
                createElementVNode("div", _hoisted_2, [
                  createElementVNode("img", {
                    style: { "width": "100%" },
                    src: __props.defaultImage,
                    alt: ""
                  }, null, 8, _hoisted_3)
                ])
              ])
            ]),
            _: 3
            /* FORWARDED */
          }, 8, ["style", "modelValue"])
        ]),
        createElementVNode("div", _hoisted_4, [
          renderSlot(_ctx.$slots, "name", {}, () => [
            createElementVNode(
              "div",
              _hoisted_5,
              toDisplayString(__props.name),
              1
              /* TEXT */
            )
          ]),
          renderSlot(_ctx.$slots, "desc", {}, () => [
            createElementVNode(
              "div",
              _hoisted_6,
              toDisplayString(__props.desc),
              1
              /* TEXT */
            )
          ])
        ])
      ]);
    };
  }
});

export { script as default };
//# sourceMappingURL=avatar.vue2.mjs.map
