import { defineComponent, computed, createElementBlock, openBlock, Fragment, createVNode, createBlock, createCommentVNode, withCtx, createTextVNode } from "vue";
import { shouldIgnoreEntity } from "@scalar/oas-utils/helpers";
import _sfc_main$1 from "./ParameterList.vue.js";
import RequestBody from "./RequestBody.vue.js";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "OperationParameters",
  props: {
    breadcrumb: {},
    parameters: { default: () => [] },
    requestBody: {},
    eventBus: {},
    options: {}
  },
  setup(__props) {
    const splitParameters = computed(
      () => (__props.parameters ?? []).reduce(
        (acc, parameter) => {
          if (!shouldIgnoreEntity(parameter)) {
            acc[parameter.in].push(parameter);
          }
          return acc;
        },
        { cookie: [], header: [], path: [], query: [] }
      )
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(Fragment, null, [
        createVNode(_sfc_main$1, {
          breadcrumb: _ctx.breadcrumb ? [..._ctx.breadcrumb, "path"] : void 0,
          eventBus: _ctx.eventBus,
          options: _ctx.options,
          parameters: splitParameters.value["path"]
        }, {
          title: withCtx(() => [..._cache[0] || (_cache[0] = [
            createTextVNode("Path Parameters", -1)
          ])]),
          _: 1
        }, 8, ["breadcrumb", "eventBus", "options", "parameters"]),
        createVNode(_sfc_main$1, {
          breadcrumb: _ctx.breadcrumb ? [..._ctx.breadcrumb, "query"] : void 0,
          eventBus: _ctx.eventBus,
          options: _ctx.options,
          parameters: splitParameters.value["query"]
        }, {
          title: withCtx(() => [..._cache[1] || (_cache[1] = [
            createTextVNode("Query Parameters", -1)
          ])]),
          _: 1
        }, 8, ["breadcrumb", "eventBus", "options", "parameters"]),
        createVNode(_sfc_main$1, {
          breadcrumb: _ctx.breadcrumb ? [..._ctx.breadcrumb, "headers"] : void 0,
          eventBus: _ctx.eventBus,
          options: _ctx.options,
          parameters: splitParameters.value["header"]
        }, {
          title: withCtx(() => [..._cache[2] || (_cache[2] = [
            createTextVNode("Headers", -1)
          ])]),
          _: 1
        }, 8, ["breadcrumb", "eventBus", "options", "parameters"]),
        createVNode(_sfc_main$1, {
          breadcrumb: _ctx.breadcrumb ? [..._ctx.breadcrumb, "cookies"] : void 0,
          eventBus: _ctx.eventBus,
          options: _ctx.options,
          parameters: splitParameters.value["cookie"]
        }, {
          title: withCtx(() => [..._cache[3] || (_cache[3] = [
            createTextVNode("Cookies", -1)
          ])]),
          _: 1
        }, 8, ["breadcrumb", "eventBus", "options", "parameters"]),
        _ctx.requestBody ? (openBlock(), createBlock(RequestBody, {
          key: 0,
          breadcrumb: _ctx.breadcrumb ? [..._ctx.breadcrumb, "body"] : void 0,
          eventBus: _ctx.eventBus,
          options: _ctx.options,
          requestBody: _ctx.requestBody
        }, {
          title: withCtx(() => [..._cache[4] || (_cache[4] = [
            createTextVNode("Body", -1)
          ])]),
          _: 1
        }, 8, ["breadcrumb", "eventBus", "options", "requestBody"])) : createCommentVNode("", true)
      ], 64);
    };
  }
});
export {
  _sfc_main as default
};
