import { defineComponent as $, computed as s, onMounted as D, openBlock as l, createBlock as a, unref as o, withCtx as t, createVNode as r, createElementVNode as S, createTextVNode as d, toDisplayString as u, createCommentVNode as f, renderSlot as _ } from "vue";
import I from "github-slugger";
import { useConfig as L } from "../../../hooks/useConfig.js";
import { useNavState as V } from "../../../hooks/useNavState.js";
import w from "../../../features/DownloadLink/DownloadLink.vue.js";
import H from "./Description.vue.js";
import B from "../../Section/SectionContainer.vue.js";
import O from "../../Section/Section.vue.js";
import { DEFAULT_INTRODUCTION_SLUG as U } from "../../../hooks/useSidebar.js";
import b from "../../Section/SectionContent.vue.js";
import C from "../../Badge/Badge.vue.js";
import A from "../../Section/SectionHeader.vue.js";
import E from "../../Section/SectionHeaderTag.vue.js";
import F from "../../Section/SectionColumns.vue.js";
import T from "../../Section/SectionColumn.vue.js";
import G from "../../SpecificationExtension/SpecificationExtension.vue.js";
const M = { class: "flex gap-1" }, R = { class: "sticky-cards" }, ne = /* @__PURE__ */ $({
  __name: "Introduction",
  props: {
    info: {},
    parsedSpec: {}
  },
  setup(h) {
    const i = h, { getHeadingId: k } = V(), m = s(
      () => {
        var e, n;
        return ((e = i.parsedSpec) == null ? void 0 : e.openapi) ?? ((n = i.parsedSpec) == null ? void 0 : n.swagger) ?? "";
      }
    ), y = new I(), N = s(() => {
      var e;
      return y.slug(((e = i.info) == null ? void 0 : e.title) ?? "");
    }), p = s(() => {
      var e, n;
      return typeof ((e = i.info) == null ? void 0 : e.version) == "string" ? i.info.version.toString().match(/^\d/) ? `v${i.info.version}` : i.info.version : typeof ((n = i.info) == null ? void 0 : n.version) == "number" ? `v${i.info.version}` : void 0;
    }), c = L();
    return D(() => {
      var e, n;
      return (n = (e = c.value).onLoaded) == null ? void 0 : n.call(e);
    }), (e, n) => (l(), a(o(B), null, {
      default: t(() => [
        r(o(O), {
          class: "introduction-section gap-12",
          id: o(k)({
            slug: o(U),
            depth: 1,
            value: "Introduction"
          })
        }, {
          default: t(() => {
            var v, g;
            return [
              r(o(b), {
                loading: o(c).isLoading ?? (!((v = e.info) != null && v.description) && !((g = e.info) != null && g.title))
              }, {
                default: t(() => [
                  S("div", M, [
                    p.value ? (l(), a(o(C), { key: 0 }, {
                      default: t(() => [
                        d(u(p.value), 1)
                      ]),
                      _: 1
                    })) : f("", !0),
                    m.value ? (l(), a(o(C), { key: 1 }, {
                      default: t(() => [
                        d("OAS " + u(m.value), 1)
                      ]),
                      _: 1
                    })) : f("", !0)
                  ]),
                  r(o(A), {
                    loading: !e.info.title,
                    tight: ""
                  }, {
                    default: t(() => [
                      r(o(E), { level: 1 }, {
                        default: t(() => [
                          d(u(e.info.title), 1)
                        ]),
                        _: 1
                      })
                    ]),
                    _: 1
                  }, 8, ["loading"]),
                  r(w, { specTitle: N.value }, null, 8, ["specTitle"]),
                  r(o(F), null, {
                    default: t(() => [
                      r(o(T), null, {
                        default: t(() => [
                          r(H, {
                            value: e.info.description
                          }, null, 8, ["value"])
                        ]),
                        _: 1
                      }),
                      e.$slots.aside ? (l(), a(o(T), { key: 0 }, {
                        default: t(() => [
                          S("div", R, [
                            _(e.$slots, "aside", {}, void 0, !0)
                          ])
                        ]),
                        _: 3
                      })) : f("", !0)
                    ]),
                    _: 3
                  }),
                  r(o(G), { value: e.info }, null, 8, ["value"])
                ]),
                _: 3
              }, 8, ["loading"]),
              _(e.$slots, "after", {}, void 0, !0)
            ];
          }),
          _: 3
        }, 8, ["id"])
      ]),
      _: 3
    }));
  }
});
export {
  ne as default
};
