import { defineComponent as S, computed as f, createElementBlock as p, openBlock as s, Fragment as y, renderList as h, createBlock as i, unref as o, withCtx as l, resolveDynamicComponent as B, createVNode as v } from "vue";
import { ScalarErrorBoundary as T } from "@scalar/components";
import $ from "./TagAccordion.vue.js";
import b from "./TagSection.vue.js";
import L from "../Lazy/Lazy.vue2.js";
import C from "../../../features/Operation/Operation.vue.js";
import { useNavState as O } from "../../../hooks/useNavState.js";
import { useSidebar as _ } from "../../../hooks/useSidebar.js";
const q = /* @__PURE__ */ S({
  __name: "TagList",
  props: {
    collection: {},
    tags: {},
    spec: {},
    layout: {},
    server: {},
    schemas: {}
  },
  setup(c) {
    const { getOperationId: n, getTagId: r, hash: z } = O(), { collapsedSidebarItems: m } = _(), I = f(
      () => c.layout === "classic" ? $ : b
    ), g = f(
      () => c.tags.findIndex((e) => !m[r(e)]) + 1
    ), u = (e) => c.layout !== "classic" && !z.value.startsWith("model") && e > g.value;
    return (e, E) => (s(!0), p(y, null, h(e.tags, (t, d) => (s(), i(o(L), {
      id: o(r)(t),
      key: o(r)(t),
      isLazy: u(d)
    }, {
      default: l(() => [
        (s(), i(B(I.value), {
          id: o(r)(t),
          collection: e.collection,
          spec: e.spec,
          tag: t
        }, {
          default: l(() => [
            (s(!0), p(y, null, h(t.operations, (a, k) => (s(), i(o(L), {
              id: o(n)(a, t),
              key: `${a.httpVerb}-${a.operationId}`,
              isLazy: u(d) || o(m)[o(r)(t)] && k > 0
            }, {
              default: l(() => [
                v(o(T), null, {
                  default: l(() => [
                    v(o(C), {
                      id: o(n)(a, t),
                      collection: e.collection,
                      layout: e.layout,
                      schemas: e.schemas,
                      server: e.server,
                      transformedOperation: a
                    }, null, 8, ["id", "collection", "layout", "schemas", "server", "transformedOperation"])
                  ]),
                  _: 2
                }, 1024)
              ]),
              _: 2
            }, 1032, ["id", "isLazy"]))), 128))
          ]),
          _: 2
        }, 1032, ["id", "collection", "spec", "tag"]))
      ]),
      _: 2
    }, 1032, ["id", "isLazy"]))), 128));
  }
});
export {
  q as default
};
