import { defineComponent, toRef, h } from 'vue';
import { _ as __nuxt_component_0$1 } from './nuxt-link-8cb59051.mjs';

function buildDomainEntityNav(path, items, options) {
  const lastIndex = path.lastIndexOf("/");
  const basePath = path.substring(0, lastIndex);
  options = options || {};
  const clazz = [
    "nav nav-pills"
  ];
  switch (options.direction) {
    case "vertical":
      clazz.push("flex-column");
      break;
  }
  let prevLink = [];
  if (options.prevLink) {
    prevLink = h("li", { class: "nav-item" }, [
      h(
        __nuxt_component_0$1,
        {
          class: "nav-link",
          to: basePath
        },
        {
          default: () => [
            h("i", { class: "fa fa-arrow-left" })
          ]
        }
      )
    ]);
  }
  const buildLink = (link) => {
    if (link.length === 0) {
      return path;
    }
    if (link.substring(0, 1) === "/") {
      return `${path}${link}`;
    }
    return `${path}/${link}`;
  };
  return h(
    "ul",
    { class: clazz },
    [
      prevLink,
      ...items.map((item) => h("li", { class: "nav-item" }, [
        h(
          __nuxt_component_0$1,
          {
            class: "nav-link",
            to: buildLink(item.urlSuffix)
          },
          {
            default: () => [
              h("i", { class: `${item.icon} pe-1` }),
              item.name
            ]
          }
        )
      ]))
    ]
  );
}
const __nuxt_component_0 = /* @__PURE__ */ defineComponent({
  props: {
    path: {
      type: String,
      required: true
    },
    items: {
      type: Array,
      required: true
    },
    direction: {
      type: String
    },
    prevLink: {
      type: Boolean
    }
  },
  setup(props) {
    const items = toRef(props, "items");
    const direction = toRef(props, "direction");
    return () => buildDomainEntityNav(props.path, items.value, {
      direction: direction.value,
      prevLink: props.prevLink
    });
  }
});

export { __nuxt_component_0 as _ };
//# sourceMappingURL=DomainEntityNav-e802c1ca.mjs.map
