'use strict';

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

var vue = require('vue');
require('../../../utils/index.js');
var dropdown = require('./dropdown.js');
require('./recursive-menu.vue.js');
var createNamespace = require('../../../utils/create-namespace.js');
var recursiveMenu_vue_vue_type_script_setup_true_lang = require('./recursive-menu.vue2.js');

"use strict";
const _hoisted_1 = { key: 0 };
var _sfc_main = /* @__PURE__ */ vue.defineComponent({
  ...{ name: "LlDropdownButton" },
  __name: "dropdown-button",
  props: dropdown.dropdownButtonProps,
  emits: dropdown.dropdownButtonEmits,
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emits = __emit;
    const bem = createNamespace.createNamespace("dropdown-button");
    const attrs = vue.useAttrs();
    const handleMenuItemClick = (item) => {
      emits("claimSelected", item);
    };
    return (_ctx, _cache) => {
      const _component_a_menu = vue.resolveComponent("a-menu");
      const _component_ll_icon = vue.resolveComponent("ll-icon");
      const _component_a_dropdown_button = vue.resolveComponent("a-dropdown-button");
      return vue.openBlock(), vue.createBlock(_component_a_dropdown_button, vue.mergeProps(vue.unref(attrs), {
        class: vue.unref(bem).b(),
        "overlay-class-name": `${_ctx.overlayClassName} ${vue.unref(bem).b("menu-wrapper")}`
      }), vue.createSlots({
        overlay: vue.withCtx(() => [
          _ctx.$slots.overlay ? vue.renderSlot(_ctx.$slots, "overlay", { key: 0 }) : (vue.openBlock(), vue.createBlock(_component_a_menu, { key: 1 }, {
            default: vue.withCtx(() => [
              vue.createVNode(recursiveMenu_vue_vue_type_script_setup_true_lang.default, {
                items: props.dropdownItems,
                onClaimSelected: handleMenuItemClick
              }, null, 8, ["items"])
            ]),
            _: 1
            /* STABLE */
          }))
        ]),
        default: vue.withCtx(() => [
          _ctx.buttonLabel ? (vue.openBlock(), vue.createElementBlock(
            "span",
            _hoisted_1,
            vue.toDisplayString(_ctx.buttonLabel),
            1
            /* TEXT */
          )) : vue.renderSlot(_ctx.$slots, "default", { key: 1 })
        ]),
        _: 2
        /* DYNAMIC */
      }, [
        _ctx.$slots.icon || _ctx.icon ? {
          name: "icon",
          fn: vue.withCtx(() => [
            _ctx.$slots.icon ? vue.renderSlot(_ctx.$slots, "icon", { key: 0 }) : (vue.openBlock(), vue.createBlock(_component_ll_icon, {
              key: 1,
              "icon-name": _ctx.icon
            }, null, 8, ["icon-name"]))
          ]),
          key: "0"
        } : void 0
      ]), 1040, ["class", "overlay-class-name"]);
    };
  }
});

exports.default = _sfc_main;
//# sourceMappingURL=dropdown-button.vue2.js.map
